Stable release · 0.2.0
Sorting that adapts to your data¶
BielSort is a stable sorting library for CPython. It accelerates favorable large integer lists with native Counting Sort or Radix Sort, then falls back to Python's Timsort whenever that is the safer or more compatible choice.
Why BielSort?¶
Adaptive by design¶
The library inspects the workload and selects Counting Sort, Radix Sort, or Timsort instead of forcing one algorithm onto every input.
Python-compatible¶
Sorting remains stable. Version 0.2 can accelerate signed-int64 results from
new-list key= calls; generic keys, in-place keys, non-integers, huge integers,
and unsuitable ordered inputs retain Python's mature Timsort.
Native fast paths¶
The C extension targets exact Python integers in the signed 64-bit range and provides both new-list and in-place operations.
Start in seconds¶
Pick the operation that matches your code¶
| Need | Python | BielSort |
|---|---|---|
| Create a new sorted list | sorted(values) |
bielsort.sort(values) |
| Mutate an existing list | values.sort() |
bielsort.sort_in_place(values) |
| See the selected strategy | — | bielsort.sort_with_strategy(values) |
| Mutate and see the strategy | — | bielsort.sort_in_place_with_strategy(values) |
| Inspect keyed algorithm and native memory | — | bielsort.sort_with_info(values, key=...) |
A specialized tool, not a universal replacement
BielSort is most interesting for large list[int] workloads. Python's
built-in sorting remains an excellent default for general objects, small
inputs, nearly ordered data, in-place keys, and keyless reverse calls. See
limits and compatibility before choosing it for a
production workload.