[Checkins] [zopefoundation/BTrees] 5ddd04: Support PURE_PYTHON at runtime.

GitHub noreply at github.com
Wed Mar 7 17:37:35 CET 2018


  Branch: refs/heads/issue78
  Home:   https://github.com/zopefoundation/BTrees
  Commit: 5ddd0442e29afe4d7ddb6f2bf5789f1b83c47af1
      https://github.com/zopefoundation/BTrees/commit/5ddd0442e29afe4d7ddb6f2bf5789f1b83c47af1
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2018-03-07 (Wed, 07 Mar 2018)

  Changed paths:
    M .travis.yml
    M BTrees/IFBTree.py
    M BTrees/IIBTree.py
    M BTrees/IOBTree.py
    M BTrees/LFBTree.py
    M BTrees/LLBTree.py
    M BTrees/LOBTree.py
    M BTrees/OIBTree.py
    M BTrees/OLBTree.py
    M BTrees/OOBTree.py
    M BTrees/_compat.py
    M BTrees/fsBTree.py
    M BTrees/tests/common.py
    M BTrees/tests/testBTrees.py
    M BTrees/tests/testBTreesUnicode.py
    M CHANGES.rst
    M appveyor.yml
    M setup.py
    M tox.ini

  Log Message:
  -----------
  Support PURE_PYTHON at runtime.

Add failing tests and then fix them. Use a common function to DRY in
all the modules.

Fixes #78

Also use zope.testrunner in tox (and travis) because it allows passing
arguments to select what tests to run, see slow tests, etc.

Simplify setup.py to always build the C modules and avoid polluting
wheel caches (the same as zope.security and other projects that have
been worked on lately).

Bump the minimum 'persistent' requirement to one that actually works
in PURE_PYTHON mode (plus fix wheel metadata; otherwise we need
environment markers).

Test PURE_PYTHON in environments on Travis. Do some minor tuning to
eliminate redundant test cases and speed up test time.


  Commit: 0b663377ca96f3c54fc071bda00cd9c05ca3c9da
      https://github.com/zopefoundation/BTrees/commit/0b663377ca96f3c54fc071bda00cd9c05ca3c9da
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2018-03-07 (Wed, 07 Mar 2018)

  Changed paths:
    M BTrees/_base.py

  Log Message:
  -----------
  Stop parsing the struct formats each time.

This makes the test runs in pure_python mode 15s faster.

Microbenchmarks on CPython 2.7.14:

$ python -m perf timeit -s 'from struct import pack,unpack' 'unpack("i", pack("i", 123456))'
.....................
Mean +- std dev: 365 ns +- 12 ns

$ python -m perf timeit -s 'from struct import Struct; s = Struct("i"); unpack=s.unpack; pack=s.pack' 'unpack(pack(123456))'
.....................
Mean +- std dev: 251 ns +- 9 ns

No appreciable difference on PyPy.


Compare: https://github.com/zopefoundation/BTrees/compare/5ddd0442e29a^...0b663377ca96


More information about the checkins mailing list