pycedar 0.2.1__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. {pycedar-0.2.1 → pycedar-0.2.2}/CHANGELOG.md +37 -1
  2. {pycedar-0.2.1/pycedar.egg-info → pycedar-0.2.2}/PKG-INFO +14 -1
  3. {pycedar-0.2.1 → pycedar-0.2.2}/README.ja.md +13 -0
  4. {pycedar-0.2.1 → pycedar-0.2.2}/README.md +13 -0
  5. pycedar-0.2.2/pycedar/VERSION +1 -0
  6. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar/pycedar.cpp +4799 -8955
  7. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar/pycedar.pyx +20 -15
  8. {pycedar-0.2.1 → pycedar-0.2.2/pycedar.egg-info}/PKG-INFO +14 -1
  9. {pycedar-0.2.1 → pycedar-0.2.2}/tests/test_pycedar.py +27 -0
  10. pycedar-0.2.1/pycedar/VERSION +0 -1
  11. {pycedar-0.2.1 → pycedar-0.2.2}/MANIFEST.in +0 -0
  12. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar/core/cedar/AUTHORS +0 -0
  13. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar/core/cedar/BSD +0 -0
  14. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar/core/cedar/COPYING +0 -0
  15. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar/core/cedar/GPL +0 -0
  16. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar/core/cedar/LGPL +0 -0
  17. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar/core/cedar/README.md +0 -0
  18. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar/core/cedar/THANKS +0 -0
  19. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar/core/cedar/src/cedarpp.h +0 -0
  20. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar/pycedar.pxd +0 -0
  21. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar.egg-info/SOURCES.txt +0 -0
  22. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar.egg-info/dependency_links.txt +0 -0
  23. {pycedar-0.2.1 → pycedar-0.2.2}/pycedar.egg-info/top_level.txt +0 -0
  24. {pycedar-0.2.1 → pycedar-0.2.2}/pyproject.toml +0 -0
  25. {pycedar-0.2.1 → pycedar-0.2.2}/setup.cfg +0 -0
  26. {pycedar-0.2.1 → pycedar-0.2.2}/setup.py +0 -0
  27. {pycedar-0.2.1 → pycedar-0.2.2}/tests/test_readme.py +0 -0
  28. {pycedar-0.2.1 → pycedar-0.2.2}/tests/test_trie_api.py +0 -0
@@ -7,6 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.2] - 2026-09-16
11
+
12
+ ### Added
13
+
14
+ - `benchmarks/bench.py`, which times the operations pycedar is used for so that
15
+ a performance change can be measured rather than assumed.
16
+
17
+ ### Changed
18
+
19
+ - `dict.get()`, `set()`, `setdefault()`, `update()` and `get_node()` are roughly
20
+ twice as fast. They were declared with a fused `str`/`bytes` parameter, and
21
+ Cython's runtime dispatch for that cost more than the trie operation itself.
22
+ The parameter is now `object`, which is what `d[key]` already used; the key
23
+ type is still enforced by the trie underneath, so behaviour is unchanged.
24
+ - Sentinel checks on the lookup paths compare against C constants instead of
25
+ building a Python tuple of Python ints on every call, which speeds up
26
+ `d[key]`, `key in d` and the traversals.
27
+
28
+ Measured on 20000 random keys, CPython 3.13, nanoseconds per operation:
29
+
30
+ | operation | 0.2.1 | 0.2.2 |
31
+ | --- | --- | --- |
32
+ | `d.get(key)` | 302 | 135 |
33
+ | `d.set(key, value)` | 242 | 108 |
34
+ | `d.update(key, delta)` | 235 | 112 |
35
+ | `d.setdefault(key)` | 290 | 129 |
36
+ | `d.get_node(key)` | 348 | 177 |
37
+ | `d[key]` | 165 | 132 |
38
+ | `key in d` | 133 | 123 |
39
+
40
+ ### Fixed
41
+
42
+ - `node.traverse()` compared integers with `is`, which only worked because
43
+ CPython interns small integers. It now uses `!=`.
44
+
10
45
  ## [0.2.1] - 2026-09-16
11
46
 
12
47
  ### Added
@@ -131,7 +166,8 @@ records; the corresponding tags were added retroactively.
131
166
 
132
167
  - Build failure with clang on macOS.
133
168
 
134
- [Unreleased]: https://github.com/akivajp/pycedar/compare/v0.2.1...HEAD
169
+ [Unreleased]: https://github.com/akivajp/pycedar/compare/v0.2.2...HEAD
170
+ [0.2.2]: https://github.com/akivajp/pycedar/compare/v0.2.1...v0.2.2
135
171
  [0.2.1]: https://github.com/akivajp/pycedar/compare/v0.2.0...v0.2.1
136
172
  [0.2.0]: https://github.com/akivajp/pycedar/compare/v0.1.3...v0.2.0
137
173
  [0.1.3]: https://github.com/akivajp/pycedar/compare/v0.1.2...v0.1.3
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycedar
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Python binding of cedar (implementation of efficiently-updatable double-array trie) using Cython
5
5
  Home-page: https://github.com/akivajp/pycedar
6
6
  Author: Akiva Miura
@@ -378,6 +378,19 @@ $ python setup.py build_ext --inplace
378
378
 
379
379
  ``./clean.sh`` removes build artifacts.
380
380
 
381
+ ### Benchmarks
382
+
383
+ ``benchmarks/bench.py`` times the operations pycedar is used for. Run it against
384
+ two builds to check whether a change actually paid off:
385
+
386
+ ```shell
387
+ $ python benchmarks/bench.py --label before
388
+ $ python benchmarks/bench.py --label after
389
+ ```
390
+
391
+ It uses ``rich`` for the table when that is installed, and plain text
392
+ otherwise. ``--help`` lists the knobs.
393
+
381
394
  ## Releasing
382
395
 
383
396
  The version lives in a single place, [``pycedar/VERSION``](pycedar/VERSION).
@@ -337,6 +337,19 @@ $ python setup.py build_ext --inplace
337
337
 
338
338
  ``./clean.sh`` でビルド生成物を削除できます。
339
339
 
340
+ ### ベンチマーク
341
+
342
+ ``benchmarks/bench.py`` が主要な操作の実行時間を計測します。変更に効果があった
343
+ かどうかは、2 つのビルドで実行して比較してください。
344
+
345
+ ```shell
346
+ $ python benchmarks/bench.py --label before
347
+ $ python benchmarks/bench.py --label after
348
+ ```
349
+
350
+ ``rich`` が入っていれば表形式で、無ければプレーンテキストで出力します。
351
+ 指定できる項目は ``--help`` を参照してください。
352
+
340
353
  ## リリース手順
341
354
 
342
355
  バージョンは [``pycedar/VERSION``](pycedar/VERSION) の 1 箇所のみで管理します。
@@ -340,6 +340,19 @@ $ python setup.py build_ext --inplace
340
340
 
341
341
  ``./clean.sh`` removes build artifacts.
342
342
 
343
+ ### Benchmarks
344
+
345
+ ``benchmarks/bench.py`` times the operations pycedar is used for. Run it against
346
+ two builds to check whether a change actually paid off:
347
+
348
+ ```shell
349
+ $ python benchmarks/bench.py --label before
350
+ $ python benchmarks/bench.py --label after
351
+ ```
352
+
353
+ It uses ``rich`` for the table when that is installed, and plain text
354
+ otherwise. ``--help`` lists the knobs.
355
+
343
356
  ## Releasing
344
357
 
345
358
  The version lives in a single place, [``pycedar/VERSION``](pycedar/VERSION).
@@ -0,0 +1 @@
1
+ 0.2.2