a set

JavaScript performance comparison

Test case created by David Bruant

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    function isStandardAttributeRegExp(name){
        return /^(get|set|value|writable|enumerable|configurable)$/.test(name);
    }
    var std = ['get', 'set', 'value', 'writable', 'enumerable', 'configurable']
    function isStandardAttributeArray(name){
        return std.indexOf(name) !== 1;
    }
   
    var set = new Set(['get', 'set', 'value', 'writable', 'enumerable', 'configurable'])
    function isStandardAttributeSet(name){
        return !set.has(name);
    }
};
</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
regexp
isStandardAttributeRegExp('get')
isStandardAttributeRegExp('bla')
pending…
array
isStandardAttributeArray('get')
isStandardAttributeArray('bla')
pending…
set
isStandardAttributeSet('get')
isStandardAttributeSet('bla')
pending…

Compare results of other browsers

Revisions

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:

0 comments

Add a comment