-
Notifications
You must be signed in to change notification settings - Fork 48
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
Slow performance compared to legacy #185
Comments
This appears to be because rotate becomes more and more inefficient if done repeatedly on a stream, If do this:
It's very fast again. Not sure if there are any downsides, going to run the tests. But using rotate on large streams probably isn't a good idea anyway. |
Yeah, there were a couple of downsides after rewriting this from Python to Elixir. Performance was indeed one of the biggest regressions. Both versions have bugs, this one is just less buggy hahaha. Ideally I would rewrite it again in Scala or Java (or some other strongly typed language), but I can barely find the time for doing so unfortunately. |
Yeah, Rust may work too (but no GC, so lots to learn) I actually did this to get some clues: https://github.com/monkeygroover/05AB1E/tree/flame hacky but helped! |
Oohh, that is clever! I will definitely have to check that out, thanks for sharing! :) |
So... I was trying Advent of Code and solved day 6 but only in legacy:
https://tio.run/##TVExTgNBDHwORRYp47VP0CPavCFIUR6QEkUKBT0foKCLRIn4QLagy5cud/Z4D1mrPXtn7PHc2rYv2I3jXbl8vV5/rr/749P@8XDf3teX7/YmNjy3U/sY2vnw0M6r4e/zuBnHWlCsqIeV6jemI2V@qVOIH5sy@OucqR84Y87FEeYM9dvIABnVI@cYexuzwIpjlVVx1nznS7BAjakssMpJgQiksWJ9lnh/eE9QTaVOcO/UAvoR/oRedJ/ASnzZP2Zso/RkQaZXSj@Fe2qvms@Vrjr3razmBrlF5VTlNFAt2DXDuI3170UfiNTeOx2U7iP4vwOdfRZflB2NrKnfDQ
however this is too slow in the elixir version, not sure why yet, stack recursion perhaps?
https://tio.run/##TVExbsMwDHxOhqpASZFGuwdZ@4YEKIxOHTwWAZKhez7QoZuBjEU@YA3Z/CXXJo9yQQgyqTvyeP7o9of3t2napOHnc/wdb@1x2750j@XrabiWM2uzK6dyaUrfPZf@obl/H1@nKSdKmsRCU7ab5sNpeclzsB2dM7LXJRM7ZIwlZ0OoMcRuBYPAyBYxR9FbkTmWDSuosrGWO16cRdAYyhwrmOQIRyoqWmex9SfrSVCToZOwd2gh@OH@uF6qPhEq/qX/mL6NwJMVGV4J/GTsKbWqNper6tg3oxobxBYZUwXTCGoJXSMU22j9XvURkFJ7h4NcfST8b0dHn9UXQUcFa@73Bw
The text was updated successfully, but these errors were encountered: