# Take these tests with a grain of salt, Depending on the operations being done, and the use case, the times may vary.
# Moreover, the operation being done within the loop will often matter much more than the speed of the loop mechanism itself.
# Author: Alexander Tsepkov

array = [9 til 100] # pregenerate array so forEach isn't penalized for element creation

bench.add('native', def():
    for JS('var i = 9; i < 100; i++'):
        pass
)
bench.add('RS regular', def():
    for i in range(9, 100):
        pass
)
bench.add('forEach', def():
    array.forEach(def():
        pass
    )
)
bench.add('til operator', def():
    # note that we're effectivelly getting penalized for building an array object here
    [9 til 100]
)
bench.add('list comprehension', def():
    # note that we're effectivelly getting penalized for building an array object here
    [i for i in array]
)
