I am actually pretty experienced with JavaScript :) Like I said, I optimized it just fine, and it's OK now. Unfortunately the browser can't really handle 16k DOM objects so it's unclear that I won't have to switch to canvases anyway, but that's a separate issue.
-
-
Replying to @cmuratori @NoHatCoder and
I don't think of JavaScript _the language_ as slow, I think of JavaScript _the object model_ as slow, and it is, pretty much period. If you just wanted to do basic stuff in JavaScript it's fine, even at high load, but if you want to work with structured data it falls apart.
0 replies 0 retweets 2 likes -
This Tweet is unavailable.
-
Replying to @fenomas @NoHatCoder and
The language definition for JavaScript doesn't permit you to do the things you would want to do to make things like style setting fast. Normally in a strongly typed language the JIT would know it could turn a elem.[string] = string assignment into direct code...
1 reply 0 retweets 6 likes -
Replying to @cmuratori @fenomas and
... but in JavaScript, it has no idea what that line means, because it doesn't even know what "elem" is. So the JITs have to resort to heroics where they try to analyze the code to figure out what can be safely turned into fast operations, and what can't.
1 reply 0 retweets 0 likes -
Replying to @cmuratori @fenomas and
A sane scripting language knows this and designs in the minimal amount of "typing" necessary to ensure that you can still have easy-to-read things that a user types, but that the compiler can know definitively what they do. JavaScript fails completely here.
1 reply 0 retweets 5 likes -
Replying to @cmuratori @fenomas and
Normally you'd just be like "yeah, it's a rookie mistake, it happens". Kinda like with HTML and CSS. But sadly, HTML/CSS/JS, despite all three being rookie mistakes across the board, ended up running the top of the entire world's software stack. So that's where we're at :(
0 replies 0 retweets 7 likes -
This Tweet is unavailable.
-
This Tweet is unavailable.
-
Replying to @fenomas @NoHatCoder and
Well again, I think the JIT is fine. It's the object model that's the problem. I haven't spent time looking at all the possible difficulties there are in JIT'ing for DOM access, but I would suspect there are many ways it can become slow.
1 reply 0 retweets 1 like
If the JIT has good visibility into a user's types and can see what's going on without too much analysis, sure, there's no reason it can't produce good native code. But that is not what's happening when you have to weld it to a complex object like a DOM element.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.