Location toString vs Location href

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Location.href
var i = 10000,
    href;

while (i) {
  href = window.location.href;
  i--;
}
ready
Location.toString
var i = 10000,
    href;

while (i) {
  href = window.location.toString();
  i--;
}
ready
Location
var i = 10000,
    href;

while (i) {
  href = '' + window.location;
  i--;
}
ready

Revisions

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