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
tools: skip common extensions on js2c #52211
base: main
Are you sure you want to change the base?
Conversation
d5ed5f8
to
05fb9a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if someone accidentally create a directory that ends with .js or .mjs? Does this actually make enough difference in the build time to stop guarding against it?
I think it's highly unlikely for someone to create a folder ending with .js, but I see your point. How can I benchmark this @joyeecheung @lemire? Any suggestions? |
I would benchmark Here is what I would in practical terms.
Since Node uses C++17, you can just do |
It seems to be an overkill microbenchmarking a utility that’s only used at build time? Shouldn’t the only metrics that matter be the % of build time this reduces? Note that, this was ported from a >10x slower Python script that had been used for many years and even then nobody really cared how slow it was….(and I think during development many people just use the configure option to load the scripts from disk, and skip JS2C entirely) |
Also to benchmark it, I would just
(Using |
Reduces system calls on
js2c.cc
forIsDirectory
function by eliminating.js
and.mjs
extensions.cc @nodejs/cpp-reviewers