lib: reduce overhead of validateObject#49928
Conversation
|
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1427/ Results |
benjamingr
left a comment
There was a problem hiding this comment.
I wonder if it wouldn't be better to just split it into 2 functions (one for default other with options) and if that would let us avoid the bit sorcery and still see the performance improvement.
|
@benjamingr Maybe, the bit sorcery still needed to not have a bunch of duplicated functions (one for each combination). I can introduce internal functions but I don't think that will be worth adding one more |
aduh95
left a comment
There was a problem hiding this comment.
According to #49928 (comment), this has little effect on the overall performance of Node.js. Still a good change to see.
|
Landed in 952cf0d |
PR-URL: nodejs#49928 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #49928 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#49928 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reducing the number of comparisons and allocations when using
validateObject.