Skip to content
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

rpc: speedup Connection::get_date_time #2777

Merged
merged 1 commit into from
Mar 19, 2025
Merged

Conversation

battlmonstr
Copy link
Contributor

Optimize away 2% of time spent in get_date_time by caching the current second Date header.

Screenshot 2025-03-06 at 16 01 14

@battlmonstr battlmonstr requested review from canepat and lupin012 March 6, 2025 15:02
@battlmonstr battlmonstr enabled auto-merge (squash) March 6, 2025 15:03
@canepat
Copy link
Member

canepat commented Mar 19, 2025

I'm not completely in favour of this change because it introduces a lock shared among the I/O contexts, which means potential lock contention.

Anyway, I'm gonna merge this because if/whenever we'll discover that the date/time computation and the associated lock become one of the relevant performance hotspots, we may even decide to remove the date/time entirely or make it compile-time optional.

@battlmonstr battlmonstr merged commit 013c04b into master Mar 19, 2025
5 checks passed
@battlmonstr battlmonstr deleted the pr/get_date_time branch March 19, 2025 15:36
@canepat canepat added the performance Performance issue or improvement label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance issue or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants