Repository navigation
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
tedious1.12.3:and
tedious1.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.