mootools/mootools-core — Issue #2251: Overwriting native functions causes performance issues in chrome (chrome 17+)
Author: satazor
Created: 2012-01-24 22:26:44+00:00
State: open

I have developed a MD5 class that is able to perform md5 hashes incrementally.
The motivation was to be able to perform it on large files, by reading files in chunks and adding each chunk to the md5 computation.

Then I experienced very huge times while doing it in chrome, and I came into conclusion that it was mootools that was slowing down the tests.

I've made a test without mootools library included and the performance increased a lot.

There's a related ticket on chromium issues: http://code.google.com/p/chromium/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Pri%20Mstone%20ReleaseBlock%20Area%20Feature%20Status%20Owner%20Summary&groupby=&sort=&id=67772

Basically this is because the force() function is overwriting String.prototype functions with...themselves... and causes chrome to loose the link and to not optimise those functions.. This does not happen in other browsers AFAIK.

Read the issue and give me your feedback.

Thanks :D