Classic property get/set vs. harmony proxy

JavaScript performance comparison

Revision 3 of this test case created by Valeriu Paloş


Profile difference between regular object property accesses and access controlled by a Harmony Proxy. I wanted to see how much slower these proxies are compared to the regular properties.

Preparation code

Benchmark.prototype.setup = function() {
    var _i = 0;
    var A = { value: null };
    var B = {};
    Object.defineProperty(B, "value", {
        value: 0,
        enumerable: true,
        configurable: false,
        writable: true
    function proxify(target) {
        return Proxy.create({
            get: function(receiver, name) {
                return target[name];
            set: function(receiver, name, value) {
                target[name] = value;
                return true;
    var C = proxify({ value: 0 });

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Classic property assignment
A.value += _i++;
Configured property assignment.
B.value += _i++;
Prototype harmony proxy assignment
C.value += _i++;

Compare results of other browsers


You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:


Comment form temporarily disabled.

Add a comment