{"push_id":781817548,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"d42920ce06853d2982f52a9023ad4652f09a9277","before":"0304b29959e898a46271e2df22b7c51a914586b0","commits":[{"sha":"d42920ce06853d2982f52a9023ad4652f09a9277","author":{"email":"4c8060af93345c2cc416ee6aa55bceec4e5cc9d4@skomski.com","name":"karl"},"message":"[es6] Use SubString in String{Starts,Ends}With\n\nMuch faster and constant than always searching the whole string\n\n````\nvar allCodePoints = [];\nfor (var i = 0; i < 65536; i++) allCodePoints[i] = i;\nvar allCharsString = String.fromCharCode.apply(String, allCodePoints);\n\nfunction bench(search) {\n  var counter = 0;\n  print(search + \" found at \" + allCharsString.startsWith(search));\n  var start = Date.now();\n  while (counter++ < 5000000) {\n    allCharsString.startsWith(search);\n  }\n  var end = Date.now();\n  print(end - start);\n  return counter;\n}\n\nprint(\"single character\");\nbench(\"\\u0000\");\nbench(\"\\u0050\");\nbench(\"\\u1000\");\n````\n\nOLD\n\nsingle character\n found at true\n374\nP found at false\n559\nက found at false\n13492\n\nNEW\n\nsingle character\n found at true\n261\nP found at false\n146\nက found at false\n146\n\nBUG=v8:4384\nLOG=N\n\nReview URL: https://codereview.chromium.org/1321853006\n\nCr-Commit-Position: refs/heads/master@{#30599}","distinct":true,"url":"https://api.github.com/repos/paul99/v8mips/commits/d42920ce06853d2982f52a9023ad4652f09a9277"}]}