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

core: skip tracer on ext/heredoc thunks #1960

Open
wants to merge 1 commit into
base: soil-staging
Choose a base branch
from
Open

Conversation

melvinw
Copy link
Collaborator

@melvinw melvinw commented May 7, 2024

The tracer overhead is guaranteed to be a waste in both of these cases. Skipping it decreases benchmarks/osh-runtime/bin_true wall time by 5-7%.

@melvinw melvinw requested a review from andychu May 7, 2024 03:11
@andychu
Copy link
Contributor

andychu commented May 7, 2024

Hmmm, surprised the effect is so big here

I was hoping to add more shell-level tracing, e.g. with TSV/JSON output and so forth

There was a Zulip thread about "zero overhead tracing as a motivation for performance"

I guess our language is kinda slow for that, and ebpf does a lot better ... but I still think there are some use cases for shell-level tracing (e.g. enhance set -x) and OILS_TRACE_DIR ...


Let me look into this a bit

@melvinw
Copy link
Collaborator Author

melvinw commented May 7, 2024

Sounds good. We could tweak SkipTrace to accept a tracer to make the decision a little smarter, too.

If I remember correctly the main thing this skips is an allocation in tracer.OnNewProcess(). I had a more targeted patch that deferred that to later that might help in lieu of this too d9cb6a2

Let me know what you decided and I'll adjust.

@melvinw
Copy link
Collaborator Author

melvinw commented May 7, 2024

One more clarification just in case it's not clear: we only skip the tracer in the child after forking (and only for ExternalThunk and HereDocWriterThunk). We still call OnProcessStart() from the parent unconditionally

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.

None yet

2 participants