Skip to content

[Uid] Add microsecond precision to UUIDv7 and optimize on x64 #21158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion components/uid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ sortable (like :ref:`ULIDs <ulid>`). It's more efficient for database indexing
**UUID v7** (UNIX timestamp)

Generates time-ordered UUIDs based on a high-resolution Unix Epoch timestamp
source (the number of milliseconds since midnight 1 Jan 1970 UTC, leap seconds excluded)
source (the number of microseconds since midnight 1 Jan 1970 UTC, leap seconds excluded)
(`read the UUIDv7 spec <https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis#name-uuid-version-7>`__).
It's recommended to use this version over UUIDv1 and UUIDv6 because it provides
better entropy (and a more strict chronological order of UUID generation)::
Expand All @@ -130,6 +130,10 @@ better entropy (and a more strict chronological order of UUID generation)::
$uuid = Uuid::v7();
// $uuid is an instance of Symfony\Component\Uid\UuidV7

.. versionadded:: 7.4

In Symfony 7.4, the precision was increased from milliseconds to microseconds.

**UUID v8** (custom)

Provides an RFC-compatible format intended for experimental or vendor-specific use cases
Expand Down