util: improve performance of function areSimilarFloatArrays#51040
util: improve performance of function areSimilarFloatArrays#51040nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM
@nodejs/v8 can you please have a look at this? It seems rather odd that the performance difference exists here.
|
Nit: @Septa2112 could you please update the commit message body's to include the "PR-URL"? That way the linter won't complain anymore 😃 |
Thanks for your suggestion. But according to my understanding, the "PR-URL" will only be generated when my commit is merged into the main branch. And I just referred to this PR #50621. Maybe the "Refs" should not be changed to "PR-URL"? So is it better to delete this |
|
|
|
Sorry, I meant to add that part. I misread the number and it can be added later on. |
Improve performance of areSimilarFloatArrays by using primordial. Refs: nodejs#50621
|
Landed in 1045f28 |
Improve performance of
areSimilarFloatArraysby using primordial.How find the issue
When I test performance between node-16.x and node-22-pre, I found performance regression in
benchmark/assert/deepequal-typedarrays.js. Old binary isnode-16.xand the new isnode-22-preOriginal result of node-16.x and node-22-pre
How solved
I found the case
benchmark/assert/deepequal-typedarrays.jswill finally call functionareSimilarFloatArrays(a, b)inlib/internal/utilwhenstrict=0 type='Float32Array'. The problem is similar with #50620. So I learned from the approach in #50621.Results
Comparison between node_16.x and node-22-pre
I modified the code in main branch (v22.0.0-pre), and compare with node_16.x
Performance improvement on main(node-22-pre)
After the change, test on the latest main branch and get the results of performance comparison of node_22 before and after modifying the code.
Refs: #50621