New issue 2569: Teach the JIT about frozenset immutability
https://bitbucket.org/pypy/pypy/issues/2569/teach-the-jit-about-frozenset-immutability

Antonio Cuni:

The JIT does not take advantage of frozenset immutability. E.g. consider this 
case:

```
TUP = ('foo', 'bar', 'baz')
FROZ = frozenset(TUP)

def main():
    x = 0
    for i in range(2000):
        x += 'foo' in TUP
        x += 'foo' in FROZ

main()
```

The JIT can constat-fold the TUP lookup but not the FROZ one.
Looking at the code, `W_FrozensetObject` lacks `_immutable_fields_`, but I'm 
not sure whether more is needed to achieve it.


_______________________________________________
pypy-issue mailing list
pypy-issue@python.org
https://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to