Prototype vs. thisdot

JavaScript performance comparison

Test case created by Andrew Nurse

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    function ThisDot(name) {
        this.name = name;
        this.toUpper = function() {
            this.name = this.name.toUpperCase();
        }
    }
    function Prototype(name) {
        this.name = name;
    }
    Prototype.prototype.toUpper = function() {
        this.name = this.name.toUpperCase();
    }
};
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
ThisDot
var c = new ThisDot(name);
c.toUpper();
pending…
Prototype
var c = new Prototype(name);
c.toUpper();
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