parseint-regex-split

JavaScript performance comparison

Test case created by dfcreative

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
parseInt
var i = parseInt("1000px")
pending…
regex
~~"1000px".replace(/(\d+)\D\D/, "$1")
pending…
split
var i = ~~"1000px".split("px")[0]
pending…
replace
~~"1000px".replace("px", "")
pending…
slice
~~"1000px".slice(0,-2)
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment