Changes between Initial Version and Version 1 of Ticket #2179, comment 33
- Timestamp:
- Oct 21, 2014, 4:27:38 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #2179, comment 33
initial v1 1 If you really go for speed use on object instead ofarray, so the test for existence doesn't involve indexOf(). Although, that really matters only above of a few hundred items. What is really slow is the use of for in and for of loops. In both cases JS goes over the iterator protocol which is factor ~70 slower than a simple while/for loop.1 If you really go for speed use an object instead of an array, so the test for existence doesn't involve indexOf(). Although, that really matters only above of a few hundred items. What is really slow is the use of for in and for of loops. In both cases JS goes over the iterator protocol which is factor ~70 slower than a simple while/for loop. 2 2 3 3 I've attached the output of the JIT Inspector for all three loop types. One can just look at the amount of opcodes SM produces to get the picture.