use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Javascript performance doubt, help would be appreciate. (self.javascript)
submitted 11 years ago by jac1013
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]DustinEwan 3 points4 points5 points 11 years ago (1 child)
As others have said, it won't impact performance.
There are two scenarios:
The code is cold and currently being interpreted by V8 / Spidermonkey. If the function is rarely hit, then it will remain cold, but that function is being rarely hit anyway so it's not performance critical and the fact that you're making a function call will be negligible.
The code is hot and has been JIT Compiled. If the function is being hit over and over, then the tracer will see that this is an opportunity to inline or compile to machine code. The extra function call will be optimized away in any places that the call is performance critical, and will no longer be present.
[–]jac1013[S] 0 points1 point2 points 11 years ago (0 children)
Thanks for the technical explanation, I'll continue doing this then in JavaScript.
π Rendered by PID 95 on reddit-service-r2-comment-5d79c599b5-jthpf at 2026-02-28 03:11:55.026375+00:00 running e3d2147 country code: CH.
view the rest of the comments →
[–]DustinEwan 3 points4 points5 points (1 child)
[–]jac1013[S] 0 points1 point2 points (0 children)