buildTree's performances improvement#7
Conversation
|
Nice! Thank you |
|
Not sure, if we should merge this into the main repository. When I run the test using Chrome 31, the classic comparison gives me the best results. |
|
Yes, the classic one is in the test as indication. It's the most efficient in Chrome, Safari iOS (and IE8) because the key is hardcoded and the javascript engine can optimize it very well. «Classic reborn» is the best in Firefox, Firefox OS and IE11. Your master branch is currently using the «dynamic key» comparison method. You can't hardcode the key because it is given in the constructor arguments. When I made the test, I started with the «classic» and the «dynamic». Then, I managed to have a dynamic method with performances close to the classic method. |
|
And I don't know why, the browserscope system doesn't work. So this my results, I tried everything I found : Chrome 31
Firefox 26
Internet Explorer 11
Safari iOS - iPad
Firefox OS on ZTE Open 😴
Chrome Android
Safari iOS is very fast compared to other ARM browsers (the difference between the zte and the android tablet is related to the hardware). |

This patch should improve buildTree's performances.
I made sorting methods comparisons here : http://jsperf.com/sort-comparaison-function and I choose the best one for Chrome/Firefox/iPad/IE
It's not perfect, a limitation is that the dimensions array should be a list of words (you can's use "{a *-" as key). But the performances gain is worth.