Missed opportunities to use `IntegerListStrategy`?
I was investigating higher-than-expected memory usage in a program running on pypy and narrowed it down to pypy not using IntegerListStrategy
for certain arrays of small ints when I expected it to. For instance
import array, __pypy__
TWO = 2
print(__pypy__.strategy([2**100 % 2]))
print(__pypy__.strategy([TWO**100 % 2]))
print(__pypy__.strategy([2**100 % TWO]))
print(__pypy__.strategy([pow(2, 100, TWO)]))
print(__pypy__.strategy([TWO + TWO]))
prints
IntegerListStrategy
ObjectListStrategy
ObjectListStrategy
IntegerListStrategy
IntegerListStrategy
It seems like if intermediate large ints are created (even if they are later reduced), ObjectListStrategy
is always used.
Is it possible to make pypy use IntegerListStrategy
for cases like the 2nd and 3rd print statements, and if not can this behaviour be documented?