type-inference-performance (v30)

Revision 30 of this benchmark created on


Setup

var x
    var array_of_ints = [0, 1, 2, 3, 4, 5]
    var array_of_floats = [0.1, 1.1, 2.1, 3.1, 4.1, 5.1]
    var array_of_strings = ['0', 'one', 'twotwo', 'threethreethree', 'fourfourfourfour', 'fivefivefivefivefive']
    var array_of_bools = [true, true, false, false, true]
    var array_of_arrays = [[1,2,3], [1,2,3], [1,2,3]] 
    
    var array_of_int_float = [0, 1.1, 2, 3.1, 4, 5.1]
    var array_of_int_string = [0, '1', 2, '3', 4, '5']
    var array_of_float_string = [0.1, '1', 2.1, '3', 4.1, '5']
    
    var array_of_mixed = [0, 1.1, '2', false, [1,2,3]]
    
    function read_array(input) {
    
        for (var i = 0; i < input.length; i++) {
            x = input[i]
        }
    }

Test runner

Ready to run.

Testing in
TestOps/sec
array of floats
read_array(array_of_floats)
ready
array of ints
read_array(array_of_ints)
ready
array of strings
read_array(array_of_strings)
ready
array of bools
read_array(array_of_bools)
ready
array of int and float
read_array(array_of_int_float)
ready
array of int and string
read_array(array_of_int_string)
ready
array of float and string
read_array(array_of_float_string)
ready
array of mixed
read_array(array_of_mixed)
ready
array of arrays
read_array(array_of_arrays)
ready

Revisions

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