Skip to content

perf: remove locking from hlc.PhysicalNow/hlc.PhysicalTime #30520

@nvb

Description

@nvb

hlc.PhysicalNow and hlc.PhysicalTime provide access to the hybrid logical clock's physical component. Accessing the hlc's state is expensive because it requires a lock acquisition for a lock which is fairly contended. As such, we should be deliberate when using the hlc and avoid using it when possible.

In a lot of cases, a system clock is more than sufficient and should be a lot cheaper. These cases include access to time in the:

We should audit uses of the hlc clock and make sure they actually need the added semantics it provides.

EDIT: the direction of this issue has changed. See #30520 (comment).

Metadata

Metadata

Labels

C-performancePerf of queries or internals. Solution not expected to change functional behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions