-
Notifications
You must be signed in to change notification settings - Fork 437
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
Remove use of generator functions #314
Conversation
What functions in particular are performance bottlenecks? |
Basically, it's every function that makes use of a generator. it's partially due to The current callback based approach is quite naive, because it goes through the I've learnt from the mistake I made with #303 / #285 and will ensure that I add benchmarks for many different parser cases and for each individual token type, helping us to benchmark and profile every change we do and to pinpoint bottlenecks. |
ffe58fa
to
abc426f
Compare
Node v4.2.1 / Tedious 1.12.3
Node v4.2.1 / Tedious 1.12.3 plus changes in this branch
I have some more changes which further bring performance back to the levels of |
Remove use of generator functions
The switch to a generator based parser in #285 brought better performance and decreased memory usage with large column values, but significantly decreased performance when processing a large number of result rows containing small column values. See #303 for more information.
This PR replaces all use of generator functions with a callback based approach. It is definately less elegant, but also has a much better performance profile.
Here's the benchmarks so far:
compared to
tedious
1.12.3:and
tedious
1.11.5:As you can see, we're still not back to the old performance, but the difference is not as big as before. There's a lot more that can be done to improve the performance even further. Basic profiling shows that a lot of time is currently spent recompiling the same functions over and over again, and there's also quite a few functions which either are never optimized or get deoptimized.