Statistical profiler in terms of engines
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- developer-experience
Research direction
Start by reading the Chez Scheme engine implementation and the system library procedures for inspecting continuation stacks; the issue points to the debugger as a model. The proposed profiler would repeatedly run a thunk with a small amount of fuel and sample its continuation, then count ticks by procedure. Done means a usable statistical profiler that returns or stores those counts; the issue does not name specific files or tests.
Written by the indexing model from the issue text.
Description
This is just an idea: would it be possible to implement a statistical (probabilistic) profiler in terms of Chez Scheme’s engines?
The idea is the profiler would take a thunk and turn it into an engine, then invoking that engine over and over with a tiny amount of fuel. Each time it would extract the continuation of the engine and inspect it to see what the original thunk was doing when it was interrupted, and add that to its profile. Once the engine is complete, return or store the profile counting the number of ticks the thunk is estimated to have spent in each procedure.
At the moment it’s not possible to get the continuation object back out of an engine. This could be solved by making an engine a wrapper procedure. The system library appears to include procedures to inspect the stack of a continuation but I don’t immediately understand how they work; presumably the debugger can help as a model to follow.
The impetus for this idea is that I had some code which was running slowly and I suspected it was a bad hash function causing lots of collisions in hashtable-set! and hashtable-ref. I don’t believe any of Chez’s existing profilers can help with situations like this where the actual slowdown can only be observed within external library code (since it would have to measure either how long these procedures took, not only how many times they were called; or it would have to measure how often they had to reprobe, which would mean annotating the Chez hash table library). In similar situations where a slowdown is only observable by knowing how long internal procedures took, this could be a helpful tool.
- Dominant language
- Scheme
- Stars
- 7.4k
- Forks
- 1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 19
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cisco/ChezScheme
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
cisco/ChezScheme#1110 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
cisco/ChezScheme#1111 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
cisco/ChezScheme#1101 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
cisco/ChezScheme#1078 · 1 comment ·
Maintainers usually reply within 1 day
-
RFC: solution to clangd not finding "scheme.h"Possibly taken @reginaldalfret claimed this 20 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
cisco/ChezScheme#1073 · 1 comment ·
Maintainers usually reply within 1 day
All issues in cisco/ChezScheme
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
YahiaAngelo/vphone-linux#70 ·
Maintainers usually reply within 1 day
-
package-request
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ScoopInstaller/Versions#3143 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
SanderMertens/flecs#2443 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ehmpathy/rhachet-roles-ehmpathy#1443 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day