Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nietaki opened this issue Nov 2, 2018 · 1 comment

Comments

@nietaki
Copy link
Contributor

nietaki commented Nov 2, 2018

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.

@CrowdHailer
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants