The javascript code that is generated by GWT for HashMap.iterator() and HashSet.iterator() are very very slow. Is there a way to speed it up?
The javascript code that is generated by GWT for HashMap.iterator() and HashSet.iterator() are very
Share
Very very slow? You’ll have to be a little bit more specific. Here’s a little example that sums up 100000 numbers:
Let’s try this on a Core2 Duo:
Here’s the output in Firefox 15 (compiled mode):
And Chrome 21 (compiled mode):
That’s slower than in dev mode:
Firefox 15 (dev mode):
Chrome 21 (dev mode):
But considering, that this is JavaScript vs Java, the results are actually pretty good.
(BTW, in case somebody wonders why the sum is different in Java (704982704) compared to JavaScript (4999950000)… this is expected, see https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsCompatibility#language)