CrowdHailer/raxx

Benchmark different Raxx.Stack state structures and switch to the fastest one

nietaki opened this issue · 1 comments

I think both the performance of the following operations is important:

  • swapping out middlewares/server
  • executing the whole stack with a long list of middlewares (many push/pop operations)

the approaches to the state structure are:

  • current one - a struct
  • a tagged tuple like {:raxx_stack, middlewares, server}
  • an untagged tuple like just {middlewares, server}

The tagged tuple is probably better in case someone needs to wade through a lot of structures while debugging some problems, so if the performance is similar to the untagged one, it's probably worth keeping.

Other than that, the convenience of use shouldn't be the main factor, it's an opaque type that no-one should really touch.

Note, once an approach is picked, inlining the functions operating on the state could also have performance benefits.

@nietaki Made a slight change to how the benchmark tests are run. 8532b65