2019-01-28 | Paul Boddie | file changeset files shortlog | Test performance with the allocation of opaque blocks containing many instances. This improves performance considerably, but the float instances are never reclaimed. Finding a way to expose the instances as they are issued would make this approach sustainable. | float-preallocation |
paul@2 | 1 | import operator |
paul@2 | 2 | |
paul@2 | 3 | def f(a, op, b): |
paul@2 | 4 | return op(a, b) |
paul@2 | 5 | |
paul@214 | 6 | print f(1, operator.add, 2) # 3 |
paul@214 | 7 | print f(1, operator.sub, 2) # -1 |