-
-
Notifications
You must be signed in to change notification settings - Fork 655
Avoid leaking TextRow/BinaryRow object outside the framework #1402
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
Conversation
|
have you tried benchmarking it (select rows with bunch of fields and also access data in every returned field) |
|
Researching if it would be helpful to have per PR automatic benchmark action - do you have an experience with that @testn ? Maybe https://github.com/benchmark-action/github-action-benchmark |
it is quite tough to benchmark this on my machine somehow. The crude benchmark I tried has very high variance (+/-70%). Can you try this and see if you see any diff? |
|
re: accessing every field, sequelize currently copies every field from TextRow object into its own object. Therefore, every field is already accessed. |
|
I'll try to benchmark locally, also wonder how reliable numbers are when run inside GH action |
|
I actually tried to optimize this one a little further by creating it as a class instead where it will cache the typeCast field information for repeated use. The generated code will look something like this |
|
With this, typeCast query that returns 1,000 rows can yield up to 5-15% gain. |
|
FYI @testn - I added benchmark workflow in #1406 but as far as I understand the way it works it compares benchmarks from current run to the previous one and I see big variations in results even with no changes in the code. I'll see if I can change it ( instead of saving bench results in the cache for later access, always perform 2 benchmarks in the same run, one for master and one for current commit ). If performance alert comments become too noisy I'll disable them |
|
could you rebase your branch so it'll run same checks as in master? I removed travis and appveyor in favour of GH actions |
|
@sidorares Let me do that. |
Avoid leaking TextRow/BinaryRow object outside the framework by returning a new object every time instead of returning this
|
@sidorares done |
Avoid leaking TextRow/BinaryRow object outside the framework by
returning a new object every time instead of returning this