This content has been marked as final. Show 5 replies
yeah, good catch. We're aware of this issue. We're trying to decide how we want to handle it.
I'd be interested in developers opinions. We could gaurd against this situation (in fact we do for integers) which could be a general perf hit on the CPU (GPUs work very different in this regard), or we could ask developers to guard against this in their code if it is expected (like in C).
Which would you guys prefer?
My personal preference is to write my own checks only when they are needed, performance being crucial sometimes.
I expect most people are not going to expect amazing performance when running on the CPU anyway, though; and potential problems could fall through testing.
This article says:
"When an if-else-endif statement is encountered, the JIT switches to scalar mode, i.e. the if-else-ending section will be expanded up to 4 times as scalar code. Anything outside of a if-else-endif block is still processed as vectors. It's best to move sampling outside of if statements if practical. The final write to the destination is always vectorized."
Would it be possible to use a guarding against the situation which doesn't switch to scalar mode? I think it would be better (for performance) than using the if statement (but I could be wrong, as always, because I don't know how it exactly works).
That'd be a good question for the Flash Player forums. The runtime in the toolkit is different than the runtime in the player for this release.
Interesting post, thanks for all, where can I find more information about this.