comparison i18n/check-translation.py @ 31584:985a98c6bad0

similar: use cheaper hash() function to test exact matches We just need a hash table {fctx.data(): fctx} which doesn't keep fctx.data() in memory. Let's simply use hash(fctx.data()) to put data out from memory, and manage collided fctx objects by list. This isn't significantly faster than using sha1, but is more correct as we know SHA-1 collision attack is getting practical. Benchmark with 50k added/removed files, on tmpfs: $ hg addremove --dry-run --time -q previous: real 12.420 secs (user 11.120+0.000 sys 1.280+0.000) this patch: real 12.350 secs (user 11.210+0.000 sys 1.140+0.000)
author Yuya Nishihara <yuya@tcha.org>
date Thu, 23 Mar 2017 20:57:27 +0900
parents 3fb36dec1727
children 29238dbf718e
comparison
equal deleted inserted replaced
31583:2efd9771323e 31584:985a98c6bad0