-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
test binarytrees working with only one thread #42774
Comments
@mr-ackerman - your program is not multi-threaded (does not make use of |
@gireeshpunathil cpu:Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz |
@mr-ackerman - let me see if I can recreate this behaviour at my end.stay tuned! |
also, what tool / method you are using to measure performance? |
@gireeshpunathil
|
thanks @mr-ackerman - with that, I am able to recreate the issue in a smaller test case, showing more than 100% perf degradation. let t1 = Date.now();
const o = {}
let temp = o
for(var i=0; i < process.argv[2] * 1000000; i++) {
temp[i] = {}
temp = temp[i]
}
let t2 = Date.now();
console.log(`time: ${t2 - t1}`)
Not sure what is responsible for this, and whether this is expected or documented somewhere. Will check with v8 team to see what do they recommend. Also let this go back to core. /cc @nodejs/v8 |
It's not as easy to assess the true performance here.
If you can, maybe try to run a linux-perf profile to see where we spend time (or |
@camillobruni
|
Perfect, could you check that this is still the case in node v17. |
looks like there are more
wherein the files with numbers are all output of
|
@camillobruni |
Can you file a bug on crbug.com/v8 mentioning the corresponding V8 versions? Thanks a lot! |
|
Version
v16.14.2
Platform
Linux chen 5.13.0-39-generic #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
Node executes 1.js and then uses
top -H -p
to view, only one thread works 100%, but the v12.18.4 version can execute concurrently with multiple threads,So when the amount of operation of the tree is large enough, v12 is more than v16 operations are fast
https://github.com/hanabi1224/Programming-Language-Benchmarks/blob/main/bench/algorithm/binarytrees/1.js
v16.14.2:
v12.18.4:
How often does it reproduce? Is there a required condition?
always
What is the expected behavior?
Can be executed concurrently by multiple threads
What do you see instead?
Only single thread works 100%
Additional information
No response
The text was updated successfully, but these errors were encountered: