Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) 2017, 2026, Oracle and/or its affiliates.
# Copyright (c) 2013, Regents of the University of California
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of
# conditions and the following disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
# micro benchmark: list comprehension


def make_lists(num):
for i in range(num):
ll = [i for i in range(10)]

return ll[-1]


def measure(num):
return make_lists(num) # 50000


def __benchmark__(num=5000):
return measure(num)
1 change: 1 addition & 0 deletions mx.graalpython/copyrights/overrides
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ graalpython/com.oracle.graal.python.benchmarks/python/micro/generator-parallel.p
graalpython/com.oracle.graal.python.benchmarks/python/micro/generator-sized.py,zippy.copyright
graalpython/com.oracle.graal.python.benchmarks/python/micro/genexp-builtin-call-sized.py,zippy.copyright
graalpython/com.oracle.graal.python.benchmarks/python/micro/list-comp.py,zippy.copyright
graalpython/com.oracle.graal.python.benchmarks/python/micro/list-comp2.py,zippy.copyright
graalpython/com.oracle.graal.python.benchmarks/python/micro/list-indexing.py,zippy.copyright
graalpython/com.oracle.graal.python.benchmarks/python/micro/list-iterating-explicit.py,zippy.copyright
graalpython/com.oracle.graal.python.benchmarks/python/micro/list-iterating.py,zippy.copyright
Expand Down
2 changes: 2 additions & 0 deletions mx.graalpython/mx_graalpython_bench_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
'generator-sized': ITER_10 + ['30_000'],
'genexp-builtin-call-sized': ITER_10 + ['50_000'],
'list-comp': ITER_10 + ['5000'],
'list-comp2': ITER_10 + ['100_000_000'],
'list-indexing': ITER_10 + ['1000000'],
'list-indexing-from-constructor': ITER_10 + ['10000000'],
'list-indexing-from-literal': ITER_10 + ['10000000'],
Expand Down Expand Up @@ -154,6 +155,7 @@
'generator-sized': ITER_10 + WARMUP_2 + ['3000', '500'],
'genexp-builtin-call-sized': ITER_10 + WARMUP_2 + ['3000', '500'],
'list-comp': ITER_15 + WARMUP_2 + ['25'],
'list-comp2': ITER_15 + WARMUP_2 + ['1000000'],
'list-indexing': ITER_6 + WARMUP_2 + ['10_000'],
'list-indexing-from-constructor': ITER_6 + WARMUP_2 + ['250_000'],
'list-indexing-from-literal': ITER_6 + WARMUP_2 + ['250_000'],
Expand Down
Loading