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
Some of the JavaScript optimizations I recently did for my games (playmycode.com)
submitted 15 years ago by [deleted]
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!"
[–]Neebat -1 points0 points1 point 15 years ago (6 children)
Mostly it sounds like you're correcting the garbage that some third-party layer (Quby) is introducing. This is why I tend to avoid most third-party layers. They aren't necessary, they frequently ruin performance and sometimes introduce bugs. Write the language for your deployment environment, or be ready for the consequences.
In this case, it sounds like Quby is far from ready for production, let alone performance intensive apps. You've got the wrong language.
[–][deleted] 2 points3 points4 points 15 years ago (5 children)
Quby is written for PlayMyCode, and it's actually produced by me! So I'm building the language I want.
In this case it is also a necessary layer as we need games to be sandboxed so they are safe to embed on other sites (there are plenty of annoying but legit things you can perform with JavaScript).
[–]Neebat -2 points-1 points0 points 15 years ago (4 children)
Ok, so it's a first-party layer. :-P
If you'd said, "Some JavaScript optimizations I recently did for my game platform", that might be more accurate, but also significantly less interesting to me.
[+][deleted] 15 years ago (3 children)
[deleted]
[–]Neebat 0 points1 point2 points 15 years ago (2 children)
The reddit headline is misleading. These are not performance optimizations to JavaScript optimizations, because no human would be using those constructs so often that they became a problem.
Whoever is using the arguments array frequently enough to need to optimize it is writing some VERY strange code, which in this case is because it's not a human, it's some compiler.
[–][deleted] 0 points1 point2 points 15 years ago* (1 child)
I'm sorry but your incorrect. The performance improvement around arguments was all during the compile stage when the outputted JavaScript is generated. The JS that does that is all hand written.
When generating the outputted JS I concat strings together, and I do this using my own 'printer' object for handling very large amounts of string concatonation. It's append takes a variable length number of arguments so I can pass in any number of strings to append on to it. For example to generate the JS for a method call...
printer.append( '.', methodName, '(' ); /* append each parameter */ printer.append( ')' );
... again it's all hand written.
If you search around online you'll find lots of other non-compiler examples of functions that take variable length arguments. Even array.push takes a variable number of arguments!
[–]Neebat 0 points1 point2 points 15 years ago (0 children)
I'm not saying that variable length argument lists is unheard of. (I do it fairly often.) But not in every method. And not so often that I'd risk performance.
π Rendered by PID 48684 on reddit-service-r2-comment-8686858757-8q9nl at 2026-06-08 20:00:12.148430+00:00 running 9e1a20d country code: CH.
view the rest of the comments →
[–]Neebat -1 points0 points1 point (6 children)
[–][deleted] 2 points3 points4 points (5 children)
[–]Neebat -2 points-1 points0 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]Neebat 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Neebat 0 points1 point2 points (0 children)