Hacker News new | ask | show | jobs
by cbsmith 5160 days ago
He's critical of the compiler's optimization and the efficiency of the code, but doesn't Flash have an embedded JIT, which effectively means the byte codes are pre-compilation, and actions that might seem like optimizations would potentially make the JIT's life far more difficult?
1 comments

How does

    (ternary (false) (integer 15) (integer 15))
help JIT?
Probably doesn't help it. Probably doesn't hurt it either though. I'm sure the JIT realizes the whole operation is pointless and just replaces it with what is effectively (integer 15). It did look like there were bits of instructions put in there to make it easier for the JIT to see where certain boundaries/behaviours were in the code, and maybe this is one of them. Or it could be something stupid that just makes it easier for them to manage the code in the flash compiler. Either way, even if it is a bug, it won't negatively impact the runtime if the JIT is doing anything like a sane job.

Think of the output of the flash compiler as being like the output of the C processor. Then it makes more sense.

It still hurts everybody, because it bloats your files with unnecessary opcodes and forces the JIT to sift through it and optimize it away, instead of spending its time to do useful optimizations.

It might only seem like a little turd on the sideway that you can easily step over, but quite evidently in the case of flash little things like these have added up and its performance is now -- in the metaphorical sense -- up to its neck in shit.

> It still hurts everybody, because it bloats your files with unnecessary opcodes

After compression, what do you figure the cost is? I mean, that looks like a lot of text, but as opcodes it's a few bytes at most before compression. Improving video codecs provides way larger gains than fixing things like this.

> forces the JIT to sift through it and optimize it away

That code is already going to be there, isn't going to burn up a measurable amount of CPU, and only imposes a cost once per load. There are better places to work on improving the product.

> It might only seem like a little turd on the sideway that you can easily step over, but quite evidently in the case of flash little things like these have added up and its performance is now -- in the metaphorical sense -- up to its neck in shit.

That's actually far from clear. I think another way to look at it is that Flash has so many other problems that focusing on this BS clearly isn't worth their (or anyone else's) time. Heck, for all we know some of this has been caused by fixes to other performance problems they've been working on.