Skip to content

[PATCH v1] linux-gen: time: optimize time conversions with multiply and shift#2344

Open
MatiasElo wants to merge 2 commits intoOpenDataPlane:masterfrom
MatiasElo:dev/time-opt-conv
Open

[PATCH v1] linux-gen: time: optimize time conversions with multiply and shift#2344
MatiasElo wants to merge 2 commits intoOpenDataPlane:masterfrom
MatiasElo:dev/time-opt-conv

Conversation

@MatiasElo
Copy link
Copy Markdown
Collaborator

No description provided.

Fix variable 'time' may be used uninitialized warnings with '-O3' option
and check validity of used warmup rounds parameter value.

Signed-off-by: Matias Elo <matias.elo@nokia.com>
Replace 64-bit divisions in _odp_time_to_ns() and _odp_time_from_ns()
with precomputed multiply-and-shift operations using 128-bit
intermediate values. Since the timer frequency is constant after init,
the required constants are computed once during _odp_time_init_global() and
used for all subsequent conversions. This eliminates two divisions and a
branch from each conversion call.

Signed-off-by: Matias Elo <matias.elo@nokia.com>
@odpbuild odpbuild changed the title linux-gen: time: optimize time conversions with multiply and shift [PATCH v1] linux-gen: time: optimize time conversions with multiply and shift Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant