Why are inputs hashes instead of strings?

For: local ITERATIONS = 5000000
Test 1 is faster:
Test 1 - String 4.9249999523163
Test 2 - Hash 5.7579998970032
Test 3 - Pre hash 5.0390000343323
Double it again, still faster:
Test 1 - String 9.646999835968
Test 2 - Hash 11.139999866486
Test 3 - Pre hash 9.8889999389648

What is occurring? Since Pre hash is the correct answer, something is fishy.

Edit: and on my laptop with 10000000:
|DEBUG:SCRIPT: Test 1 - String|6.6852281093597|
|DEBUG:SCRIPT: Test 2 - Hash|7.8060331344604|
|DEBUG:SCRIPT: Test 3 - Pre hash|6.765282869339|
Strings win again, never trust a test…
Repeat with test 3 run first:
|DEBUG:SCRIPT: Test 3 - Pre hash|6.7839930057526|
|DEBUG:SCRIPT: Test 1 - String|6.8664541244507|
|DEBUG:SCRIPT: Test 2 - Hash|7.1882319450378|
At last, the correct result! Yay.
Lies, dam lies, statistics and speed tests.

1 Like