-
Notifications
You must be signed in to change notification settings - Fork 7
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
manually inlining validator functions improves performance #154
Comments
can you share the benchmark? |
This is not surprising, the inline version doesn't need |
Maybe we could make the "stack hiding" feature opt-in/opt-out. I'm not sure what's the use-case behind that, but I think many folks would gladly take the extra stack lines as a tradeoff for the increase performance. |
What is going here? V8 ought to be able to inline the function during the JIT compilation, no? function validateString(value, name) {
if (typeof value !== 'string') {
throw new ERR_INVALID_ARG_TYPE(name, 'String', value);
}
} Why won't it? |
I dont know but I think this is because you pass by val and not by ref. |
Lets take the isAbsolute function of posix in the path module.
Benchmark it:
inline validateString
Annoying...
The text was updated successfully, but these errors were encountered: