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

Reduce timing overhead #273

Merged
merged 30 commits into from
Aug 1, 2024
Merged

Reduce timing overhead #273

merged 30 commits into from
Aug 1, 2024

Conversation

joerick
Copy link
Owner

@joerick joerick commented Oct 14, 2023

Addressing #270.

Couple of approaches.

If CLOCK_MONOTONIC_COARSE is available on the system and the desired profiling interval is slow enough, that timer is used. This timer is very low overhead, as it just accesses a variable in user-space, and never makes a syscall.

Alternatively, if the user requests it, the profiler will run a timing thread. This is a C thread that runs outside the GIL and updates a variable with the current time every <interval> seconds.

@joerick
Copy link
Owner Author

joerick commented Oct 15, 2023

I think I've figured out the ctypes thing. It seems that loading the .so file with the path works on both linux and mac.

@dralley
Copy link

dralley commented Oct 16, 2023

Also potentially addressing #83

@joerick joerick marked this pull request as ready for review July 31, 2024 16:14
@joerick joerick merged commit afbf6bb into main Aug 1, 2024
27 checks passed
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.

2 participants