vineet-sinha/noVNC — comment on commit 631ccbcc6ed296d7de13dbb298ad626fd3a1766b
File:  line 0
By kanaka:

BTW, I'm not sure how well GWT will optimize this code, but these changes are in the extremely hot section of the code and you've introduced a lot of indirection here that may have significant performance impact.

For example, the code used to look more like:

for ( ... long loop ... ) {
...
tile.data[i + 1] = green;
...
}

This simple change to remove a single layer of property dereferencing made a big performance difference:

data = tile.data;
for ( ... long loop ... ) {
...
data[i + 1] = green;
...
}

You've added several levels of indirection in those sections including a function call. Unless GWT does really good inlining and loop optimization I suspect you will suffer a significant performance issue compared to the existing Javascript code. I've done a lot of hand performance tuning and optimization on noVNC (especially display.js). And those optimizations are balanced across several browsers (sometimes a change that helps on one will severely hinder on a different browser).

Another area that you may experience issues is in the receive queue handling where I've noticed you are doing abstracting into JSUtils. This is another area where I removed abstractions in order to get better performance.

I've been watching the changes and just thought I would weigh in on something that could be an issue for you (depending on how well GWT optimization works).