prototype operator performance, saves memory, but is it faster

Benchmark created by Marco Demaio on


Test runner

Ready to run.

Testing in
TestOps/sec
Y method is declared into the Javscript object class
for (i = 0; i < 1000000; i++) {
 y = new Y();
 y.message('hi');
 y.addition(i, 2)
}
ready
X method is declared outside class by using protoype keyword
for (i = 0; i < 1000000; i++) {
 x = new X();
 x.message('hi');
 x.addition(i, 2)
}
ready

Revisions

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

  • Revision 1: published by Marco Demaio on
  • Revision 2: published by EWGL on