resourceloader: Use MD4 to compute file hash rather than SHA1
authorOri Livneh <ori@wikimedia.org>
Wed, 16 Sep 2015 23:51:53 +0000 (16:51 -0700)
committerOri.livneh <ori@wikimedia.org>
Fri, 18 Sep 2015 22:26:55 +0000 (22:26 +0000)
commit935e24f9cdde858d3e00e48105f7c8e7c45eb2bf
tree5e91f999cd1c037ec2f4cae465a4cfd5051fdb9e
parent0fc3b0850c0def14a213dc7f0278444948762f82
resourceloader: Use MD4 to compute file hash rather than SHA1

The hash value generated by ResourceLoaderModule::safeFileHash() is used for
versioning and cache invalidation, so a cryptographic hash function is not
necessary. We can get better performance by using MD4.

Wikimedia on-CPU time over 24 hours of safeFileHash() in load.php:
* 6.68% with safeFileHash using SHA1 (day 1)
* 7.07% with safeFileHash using SHA1 (day 2)
* 2.84% with safeFileHash using MD4 (day 3)

Change-Id: I6ff728f1240268517c0f03e0823129316bc901cb
includes/resourceloader/ResourceLoaderModule.php