A fast and thorough lazy object proxy
Project description
A fast and thorough lazy object proxy.
Free software: BSD license
Installation
pip install lazy-object-proxy
Documentation
Development
To run the all tests run:
tox
Benchmarks
The tested implementations:
lazy_object_proxy.slots.Proxy, available as lazy_object_proxy.Proxy if the C extension is not available.
lazy_object_proxy.cext.Proxy, available as lazy_object_proxy.Proxy.
objproxies - fork of PJE’s ProxyTypes with Python 3 support. [1]
SimpleLazyObject from Django. [1]
lazy_object_proxy.simple.Proxy - uses the non-data descriptor trick. [1]
For Python 2.7:
------ benchmark: min 5 rounds (of min 25.00us), 5.00s max time, timer: time.clock ----- Name (time in ns) Min Max Mean StdDev Rounds Iterations ---------------------------------------------------------------------------------------- test_perf[slots] 705.3837 3091.0072 720.4805 27.2588 180453 38 test_perf[cext] 93.6346 278.9731 95.1876 2.5474 164373 312 test_perf[simple] 398.1636 1863.2017 405.4325 13.1411 207521 59 test_perf[django] 471.6515 983.0809 480.4264 10.2059 193043 53 test_perf[objproxies] 1204.7003 4818.8010 1475.3419 114.8213 55898 1 ----------------------------------------------------------------------------------------
For Python 3.4:
-- benchmark: min 5 rounds (of min 25.00us), 5.00s max time, timer: time.perf_counter -- Name (time in ns) Min Max Mean StdDev Rounds Iterations ---------------------------------------------------------------------------------------- test_perf[slots] 803.1335 2728.8286 826.0882 20.5562 182436 33 test_perf[cext] 103.2911 254.4223 104.6869 2.6294 164373 277 test_perf[simple] 448.6894 2040.6147 462.0342 17.1546 218443 49 test_perf[django] 518.3013 1225.7125 532.0523 14.4672 218443 43 test_perf[objproxies] 1116.8575 3827.4331 1157.8419 43.9602 174755 24 ----------------------------------------------------------------------------------------
For PyPy 2.4:
Note that the mean difference between simple, django and objproxies is smaller the standard deviance, thus it cannot be considered.
------ benchmark: min 5 rounds (of min 25.00us), 15.00s max time, timer: time.clock ---- Name (time in ns) Min Max Mean StdDev Rounds Iterations ---------------------------------------------------------------------------------------- test_perf[slots] 1.9577 260.2979 2.2457 0.4882 498050 15384 test_perf[simple] 31.3536 4374.4246 34.7433 11.7566 478894 999 test_perf[django] 32.5269 4443.8381 35.8729 16.9071 461157 1000 test_perf[objproxies] 33.1293 4529.3718 36.7435 13.3377 452773 1000 ----------------------------------------------------------------------------------------
Changelog
1.0.2 (2015-04-11)
Remove the bogus lazy_object_proxy console script (contributed by Tin Tvrtković in #4).
1.0.1 (2014-12-28)
Fix access via class bug in the __wrapped__ property from lazy_object_proxy.simple.Proxy.
1.0.0 (2014-12-27)
General code cleanup
A faster pure-python Proxy implementation (lazy_object_proxy.simple.Proxy) to be used where the C extension is not available. It’s not a complete proxy so it’s never available as lazy_object_proxy.Proxy.
0.1.0 (2014-06-10)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for lazy_object_proxy-1.0.2-cp34-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 178c83d3085acce5a6bf5819ba68e1fadbc31b6b16585697661fe4848483b5b7 |
|
MD5 | 08581104e93317601db3341389e49dba |
|
BLAKE2b-256 | 35259af9ae872bcb4fdb5aaec22a1c42e5017f4f336cc0a70c06daa5f0e781db |
Hashes for lazy_object_proxy-1.0.2-cp34-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8c0674b4064b8797ea3bf7e0190ffb6c8136622877c5697f42dd80f3c007846 |
|
MD5 | 9c1ef541ed31e2128e2a0ff7178ff6e9 |
|
BLAKE2b-256 | 1a4e07adc188b4b2fc5ed1a5b67cdbf05a606e40d852a75c943c724f07ccff54 |
Hashes for lazy_object_proxy-1.0.2-cp33-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a7d14e289579e335dbc3b937af2364440ec8779107f734b488b10abfe117748 |
|
MD5 | 25548a9b189cbebae05f06eba4314faf |
|
BLAKE2b-256 | 5ac074f34360c078bb035be8dde14c6e9adb86a7034adb32315489207bc818ed |
Hashes for lazy_object_proxy-1.0.2-cp33-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2adce5e2324e19d639fa829673a71c8ef3a8d07f1b3f773bfe6e8ecb2c7e50e7 |
|
MD5 | d8694801026f1cca52c1bc2a0b39d7f3 |
|
BLAKE2b-256 | 03f20a1fc1f775aaaf3e4754be6438cb81bf1fc6b65be6e9d146b8fcc7cf4fba |
Hashes for lazy_object_proxy-1.0.2-cp27-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 212b07b0a21a3df7148304826bed7d391c9308a02a512623e85b9ee0aac7c382 |
|
MD5 | 3420966864f97b982b844b5fb8bd4688 |
|
BLAKE2b-256 | fd887f507b5c6e097b723e12965c701cb66370b364f09aebb9b2bd74d5bdc30b |
Hashes for lazy_object_proxy-1.0.2-cp27-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abe2e1bc999465948a960f8f2f1255474f6eefb82a3f3f1c336f39a4b1ba8d98 |
|
MD5 | beb92c0a346569eae6339730e97abb3e |
|
BLAKE2b-256 | f1c1bc365cb785acf46fa6c81c2f7287bdec4459dfaebefd83b1319e9b7ce6b3 |