Skip to content

Releases

fastuuid7 0.6.1

Choose a tag to compare

@nekrasovp nekrasovp released this 11 Nov 07:59

fastuuid7 0.6.1 speeds up UUID formatting and strict parsing while preserving the public UUID types and input contracts. PR #17 is merged.

Changes

  • Format exact standard UUID objects directly from their integer value, avoiding intermediate Python bytes.
  • Accelerate str(uuid7()) while retaining stdlib behavior for custom subclasses and unusual integer values.
  • Decode strict UUID text with a bounded hexadecimal lookup and fixed canonical offsets. The accepted formats, error behavior and all 128 bits are preserved.
  • Add installed-wheel comparisons with published fastuuid7 0.6.0 and uuid-utils 1.2.0: UUID microbenchmarks, separate Pydantic stages and real loopback FastAPI HTTP requests.
  • Allow a newer candidate version in the benchmark while enforcing the published 0.6.0 baseline and identical remaining dependencies.

Compatibility and application performance

CPython 3.9–3.15 remains supported on Linux, macOS and Windows. Both fastuuid7 and uuidv7 imports remain available. There are no new runtime dependencies or automatic framework hooks. UUID generation entropy, fork handling and ordering contracts are unchanged.

The core optimization is not a general FastAPI speed claim. The benchmark compares built-in Pydantic with explicit adapters and preserves native-versus-standard UUID distinctions. Keep built-in Pydantic handling by default; fixed-load loopback observations are not production capacity measurements. str(uuid4()) still uses the stdlib formatter; string-only callers can use uuid4_str() or format an existing UUID with format_uuid().

Validation

  • Release source: 5a46ffc6f9956fc4ca575aaaabf86478d1d83473. PR #17 merged as d618683cf8c0524645716b21a442f8bb23e0e9b4.
  • Fresh git clone --no-local: 856 tests, Ruff, formatting, mypy, actionlint, release-version checks, source/wheel builds, Twine and package-content checks passed.
  • Installed macOS ARM64 / CPython 3.14 wheel: both import paths and generation/parsing/history/batch smoke checks passed, followed by 412 tests outside the checkout.
  • Release-commit CI and benchmark links, comparison notes and artifact hashes accompany the attached evidence.

Install with python -m pip install --upgrade fastuuid7==0.6.1.

Measurements from the release commit

On the two Linux / AMD EPYC 7763 release jobs (Python 3.12 and 3.14), existing UUID formatting takes 61-65% less time, and generation plus str(uuid7()) 54-64% less time, compared with published 0.6.0. Packed batch parsing takes about 30-31% less time.

Scalar parsing improves only 1-3% by median on these runners, with the Python 3.12 interval including zero; object-batch parsing is likewise small/inconclusive in one cohort. Retained v7 generation is 1.5-3.4% slower. These installed-wheel observations include compiler/host effects and do not imply uniform gains on every platform. The earlier three-cohort sprint evidence remains in the repository with its original source identity.

The final FastAPI/Pydantic matrix checked 100,800 HTTP responses with zero errors or scheduling-overload flags. Its explicit adapters still trail built-in Pydantic for the 1,000-UUID JSON round trip. Full CPU/latency tables, intervals, losses and interpretation are in REVIEW.md inside the evidence archive.

All 39 checks in nine workflows passed on the release commit:

Evidence archive SHA-256: cbe11e60df0f1ba6020ec6649d259483495d0638755ad391e11e7271665b131a.

Published package verification

PyPI 0.6.1 is published. The trusted-publishing workflow passed all nine jobs on the release tag. All 63 wheels and the source archive match its artifacts by filename and SHA-256. Python metadata is >=3.9, SPDX license is MIT, and project links are verified.

A fresh macOS ARM64 / CPython 3.14 environment installed the wheel from the public PyPI index with the uv cache disabled. Both import paths and generation/parsing/history/batch smoke checks passed, followed by 412 installed-wheel tests. All nine installed runtime files match the publishing wheel byte-for-byte. The attached verification manifest records every distribution hash and the installed-wheel result.

fastuuid7 0.6.0

Choose a tag to compare

@nekrasovp nekrasovp released this 09 Nov 10:04

fastuuid7 0.6.0 adds random UUIDv4 generation and strict UUID parsing/formatting while retaining standard-library UUID outputs and the existing UUIDv7 APIs.

New APIs

  • uuid4(), uuid4_str(), uuid4_bytes() and their _many variants use the shared operating-system CSPRNG pool.
  • parse() and parse_many() return standard uuid.UUID objects; parse_bytes_many() returns packed network-order bytes.
  • format_uuid() formats a standard UUID, UUID7Obj, or 16 bytes as canonical lowercase text.
  • Typed APIs remain available through both fastuuid7 and uuidv7.

Compatibility and behavior

  • Stable CPython support now spans 3.9–3.15, with tested wheels for Linux, macOS and Windows.
  • POSIX fork invalidation uses a native pthread_atfork child handler, eliminating per-UUID PID syscalls. Failed hook registration falls back to checking the PID. This covers os.fork() and libc fork(); raw kernel clone/fork calls bypassing libc hooks are outside this contract.
  • UUIDv4 has no ordering guarantee and does not advance the live UUIDv7 clock/counter.
  • The parser accepts four documented ASCII formats, including case-insensitive URNs. Its grammar is intentionally narrower than the stdlib UUID constructor; all UUID versions/variants retain all 128 bits.
  • No new runtime dependencies, automatic framework validator replacement, ABI3 or GIL-free production support.

Validation and evidence

Release-source identity, final CI links and artifact hashes accompany this release. Benchmark attachments were generated from the exact release commit and distinguish standard/native outputs, retained/discarded results, serialization and packed batches. Microbenchmarks do not establish an application-level speedup; compare the same output and entropy/ordering contracts.

Tests cover malformed input, arbitrary 128-bit round trips, entropy failures, partial reads, fork handling, clock rollback, batch cleanup, installed wheels, PostgreSQL/framework integrations, and local LangChain/LangSmith UUID consumption.

Release verification

  • Source commit: d733169281a1d8039a891e6334aa6281007fd638. PR #16 merged as 363a7866fb1a21dcd5351af231fbb4264353fe55.
  • Clean-clone validation: 714 tests, Ruff, formatting, mypy, actionlint, source/wheel build and Twine checks passed. The installed macOS CPython 3.14 wheel passed 275 tests outside the checkout.
  • CI: 10 successful jobs.
  • PostgreSQL workloads: 1 successful job.
  • UUID integrations: 9 successful jobs.
  • Benchmark: 4 successful jobs.
  • Wheels: 7 successful jobs.
  • Graph Update: uv in /., /tools/consumers #1689743031: 1 successful job.
  • Python 3.15: 3 successful jobs.
  • UUID operation benchmarks: 2 successful jobs.
  • Attached evidence contains scalar/competitor/batch reports, all three clock experiments, installed-wheel UUID operation measurements on Python 3.12/3.14, and the PostgreSQL 18 matrix. REVIEW.md explains exclusions and comparison limits; manifest.json records SHA-256 hashes.
  • Evidence archive SHA-256: c2f6f1fdb0f7d6093c689bf88501818ca67693528dfeece187cd0643a8db6981.

Published package verification

PyPI 0.6.0 is published. The trusted-publishing workflow passed all nine jobs. All 63 wheels and the source archive match the workflow artifacts by filename and SHA-256. Python metadata is >=3.9, SPDX license is MIT, and project links are verified.

A clean macOS ARM64 / CPython 3.14 environment installed the published wheel from the public PyPI index with the uv cache disabled. Both import paths and UUIDv4/v7, parsing, historical and batch smoke checks passed, followed by 275 installed-wheel tests. All nine installed runtime files match the publishing wheel byte-for-byte. The attached PyPI verification manifest records every artifact hash and the installed-wheel result.

fastuuid7 0.5.0

Choose a tag to compare

@nekrasovp nekrasovp released this 17 Sep 22:54
4d99123

fastuuid7 0.5.0 adds historical batch generation and executable application compatibility checks. It combines all six development tracks in PR #14.

from fastuuid7 import uuid7_at_many

ids = uuid7_at_many(unix_ms=[1_645_557_742_123, 1_645_557_742_124])

The keyword-only API snapshots and validates the whole finite iterable before generating IDs. Each timestamp is preserved exactly, with fresh OS randomness. It returns no partial batch on failure and leaves live generator ordering state independent. The resumable SQLite example persists mappings and updates related records transactionally.

Also included:

  • Real PostgreSQL integration tests for SQLAlchemy, Django, Pydantic/FastAPI and psycopg, plus UUID property tests.
  • PostgreSQL 18 bulk INSERT, binary COPY and historical-import measurements with pinned libraries, verified rows and source provenance.
  • Public PyLongWriter conversion on Python 3.14+ and a separate Linux/macOS/Windows Python 3.15.0rc2 matrix.
  • Adoption guidance, attributable public-source evidence and a technical article draft.
  • An isolated free-threading prototype and ADR. Production continues to require the GIL; no free-threaded or ABI3 wheel support is claimed.

Stable support remains Python 3.9–3.14. No mandatory runtime dependencies were added. The uuidv7 import path remains supported.

Validation includes 527 tests with real PostgreSQL integrations in a clean candidate clone, 520 core/property tests in a fresh clone of the merged source, and 97 installed-wheel tests for both the direct build and a wheel rebuilt from the sdist. All 33 candidate CI checks and all 27 exact-main checks passed. The Windows wheel job needed one retry after a virtualenv interpreter-discovery timeout before compilation; the unchanged-source retry passed. Exact-main benchmark and workload reports are attached with a SHA-256 manifest; source and distribution verification records are attached separately.

On the exact merged source, historical COPY of 100,000 rows took 0.469 s with uuid7_at_many() versus 0.588 s with scalar uuid7_at() (medians of three runs, about 20% less elapsed time). Published 0.4.0 scalar took 0.576 s. All 69 measurements and 23 warmups committed and verified their rows: 9.2 million rows.

The UUID-object scalar microbenchmark was 321.7 ns in 0.5.0 versus 309.7 ns in published 0.4.0 (about 4% slower in that shared-runner sample). This tradeoff accompanies the public integer-conversion API; it is not hidden behind the historical-batch result.

The database workload uses one client, initially empty tables, 100,000 rows per sample, one warmup and three measured repetitions. Results are measurements of that setup, not a production throughput promise. The scalar and competitor reports retain matched-shape/guarantee labels and explicit rejected legacy-layout cases; this release makes no universal speedup claim.

Changelog · API · Integration checks · Workload methodology

Upgrade with pip install --upgrade fastuuid7 or uv add fastuuid7@0.5.0.

fastuuid7 0.4.0

Choose a tag to compare

@nekrasovp nekrasovp released this 17 Sep 06:56
0386e15

Adds historical UUIDv7 generation and refreshes the benchmark suite against current, pinned implementations.

from fastuuid7 import uuid7_at

record_id = uuid7_at(unix_ms=1_645_557_742_123)
assert record_id.time == 1_645_557_742_123
  • uuid7_at(*, unix_ms=...) preserves the exact timestamp and uses 74 OS-CSPRNG random bits. It does not advance the live generator's monotonic state. Repeated calls for one timestamp produce fresh random identifiers, with no within-millisecond ordering guarantee.
  • Counter/timestamp exhaustion raises OverflowError instead of wrapping. Tests exercise carry boundaries, repeated rollback, historical/live isolation, fork entropy and subprocess execution.
  • Comparisons pin versions, isolate each case in a fresh process, validate output types and timestamp layout, and disclose entropy/order/fork guarantees. The secure baseline is fastuuid7 0.3.0. Legacy-draft packages are explicitly rejected.
  • The batch-clock experiment measures reduced clock-read overhead and stale timestamps after a scheduling pause. Production batches retain per-UUID clock reads and the existing monotonicity/CSPRNG contract.
  • Wheel validation runs installed-package smoke and boundary tests across Linux glibc/musl, macOS and Windows. Older Windows Python clock resolution is handled explicitly in timestamp checks.

Existing scalar and batch calls remain compatible. Python 3.9–3.14 and both fastuuid7 / uuidv7 imports remain supported. Development dependencies are locked; mypy remains on the Python-3.9-compatible release line.

The attached reports are generated by CI from the release source. Compare matching representations and generation guarantees; this release makes no blanket speedup claim over 0.3.0.

API and historical-record contract · Migration recipe · Full changelog

Release source: 0386e15. CI · Wheel validation · Benchmark run. The benchmark manifest records source identity and report SHA-256 digests.

Published on PyPI: 54 wheels and one source archive. All 55 filenames and SHA-256 digests match the publish workflow. A fresh PyPI wheel installation on macOS ARM64/Python 3.14 passed the installed-package smoke check and all 55 runtime/boundary tests. The source suite contains 65 passing tests. See pypi-verification.json for the artifact digest record.

fastuuid7 0.3.0

Choose a tag to compare

@nekrasovp nekrasovp released this 12 Jul 17:30
c79cf53

fastuuid7 0.3.0

fastuuid7 0.3.0 is a security-focused release that makes UUIDv7 generation
fork-safe, moves random fields to the operating-system CSPRNG, and adds native
batch generation without breaking the existing uuidv7 import path.

Highlights

  • Random UUID fields now come from the operating-system CSPRNG.
  • Inherited entropy and generator counters are discarded automatically after
    fork().
  • fastuuid7.uuid7() returns uuid.UUID, matching Python 3.14's
    uuid.uuid7() API.
  • New native batch functions generate UUID objects, compact native objects,
    canonical strings, or contiguous bytes in one C call.
  • fastuuid7 is now the canonical import; uuidv7 remains fully supported for
    existing applications.
  • Both import paths ship type stubs and py.typed markers.
  • Wheels cover Python 3.9-3.14 on Linux glibc/musl x86-64 and ARM64, macOS
    x86-64 and ARM64, and Windows x86, x86-64, and ARM64.

Performance

The release-candidate CI benchmark on Linux x86-64 with Python 3.14.6 measured:

API and output shape UUIDs/second
uuid7_obj() -> compact native object 4,203,518
uuid7_bytes() -> 16-byte bytes 4,001,849
uuid7_str() -> canonical string 3,684,967
uuid7() -> uuid.UUID 2,787,555
Python 3.14 uuid.uuid7() -> uuid.UUID 517,197

The like-for-like uuid.UUID API was 5.4x faster than the Python 3.14 standard
library in this CI run. Results vary by machine. Output shapes and security
guarantees matter when comparing generators; see the exact benchmark report:
#5 (comment)

For batches of 10,000 values, the native batch APIs reduced per-UUID overhead
for every output shape in the same run. Contiguous bytes improved from 267.6 to
191.4 ns/UUID, a 1.40x speedup over a Python loop.

Upgrade notes

  • Python 3.9 or newer is required. Python 3.8 is end-of-life and remains on the
    unsupported 0.2.x line unless Python is upgraded.
  • Existing from uuidv7 import ... imports continue to work.
  • UUIDv7 values expose their creation timestamp by design and must not be used
    as secrets or authentication tokens.

Install or upgrade with:

python -m pip install --upgrade fastuuid7

See the changelog and migration-compatible API documentation for details.

fastuuid7 0.2.0

Choose a tag to compare

@nekrasovp nekrasovp released this 19 Jun 06:49

Highlights

  • Added a UUID-compatible C fast path for uuidv7.uuid7() returning a uuid.UUID-compatible object.
  • Added uuidv7.uuid7_obj(), a compact native UUIDv7 object for maximum throughput.
  • Added full competitor benchmarks against uuid-utils, c_uuid_v7, uuid7-rs, fastuuidv7, uuid6, uuid7, and uuid-v7.
  • Improved raw fast paths and compiled extension builds with optimization flags.
  • Verified Linux, macOS Intel/arm64, and Windows wheel builds.

Performance snapshot

Local CPython 3.12.3, Linux x86_64, 1,000,000 iterations, 5 rounds:

  • uuidv7.uuid7_obj(): 35.6 ns/op best, 36.2 ns/op median
  • uuidv7.uuid7(): 75.0 ns/op best, 75.6 ns/op median
  • c_uuid_v7.uuid7(): 34.1 ns/op best
  • uuid7_rs.uuid7(): 35.0 ns/op best

Validation

  • GitHub CI passed on Python 3.8 through 3.14.
  • GitHub Wheels workflow passed for Linux, macOS Intel, macOS arm64, and Windows.
  • GitHub Benchmark workflow passed.

v0.1.0 - Initial Release

Choose a tag to compare

@nekrasovp nekrasovp released this 23 Jan 14:11

fastuuid7 v0.1.0 - Initial Release

🎉 First Release

This is the initial release of fastuuid7 - a high-performance UUID v7 generation library implemented in C with Python bindings.

✨ Features

  • ⚡ High Performance: Generate 500,000+ UUIDs per second
  • 🐍 Python 3.8+ Support: Works with Python 3.8 through 3.14+
  • 📦 RFC 9562 Compliant: Fully compliant UUID v7 format
  • 🔒 Thread-Safe: Safe for use in multi-threaded applications
  • 🎯 Standard API: Matches Python 3.14+ uuid.uuid7() API style

📊 Performance

Our C implementation is:

  • 10.26x faster than pure Python implementations
  • 10.63x faster than Python's built-in uuid.uuid7() (Python 3.14+)
  • 16.56x faster than uuid7 library from PyPI

See Performance Benchmarks for detailed results.

🚀 Installation

pip install fastuuid7

Or using uv:

uv pip install fastuuid7

📖 Usage

from uuidv7 import uuid7

# Generate a UUID v7
uuid = uuid7()
print(uuid)  # e.g., "018f1234-5678-7abc-def0-123456789abc"

📚 Documentation

🔗 Links

🙏 Credits

Developed by Pavel Nekrasov

📄 License

MIT License - see LICENSE file for details