Function.toString vs JSON.stringify

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Function.toString
var x = function(){scope.blah}.toString().slice(18, -1);
ready
JSON.stringify
var x = JSON.stringify({blah: 0}).slice(2, -4);
ready

Revisions

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