1 from pybench
import Test
3 class SimpleListManipulation(Test
):
6 operations
= 5* (6 + 6 + 6)
14 for i
in xrange(self
.rounds
):
130 for i
in xrange(self
.rounds
):
133 class ListSlicing(Test
):
136 operations
= 25*(3+1+2+1)
144 for i
in xrange(self
.rounds
):
163 for i
in xrange(self
.rounds
):
167 class SmallLists(Test
):
170 operations
= 5*(1+ 6 + 6 + 3 + 1)
175 for i
in xrange(self
.rounds
):
294 for i
in xrange(self
.rounds
):
297 class SimpleListComprehensions(Test
):
307 for i
in xrange(self
.rounds
):
309 l
= [x
for x
in n
if x
]
310 l
= [x
for x
in n
if not x
]
313 l
= [x
for x
in n
if x
]
314 l
= [x
for x
in n
if not x
]
320 for i
in xrange(self
.rounds
):
323 class NestedListComprehensions(Test
):
334 for i
in xrange(self
.rounds
):
335 l
= [x
for x
in n
for y
in m
]
336 l
= [y
for x
in n
for y
in m
]
338 l
= [x
for x
in n
for y
in m
if y
]
339 l
= [y
for x
in n
for y
in m
if x
]
341 l
= [x
for x
in n
for y
in m
if not y
]
342 l
= [y
for x
in n
for y
in m
if not x
]
349 for i
in xrange(self
.rounds
):