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

port partr multiq to julia #44653

Merged
merged 1 commit into from
Mar 23, 2022
Merged

port partr multiq to julia #44653

merged 1 commit into from
Mar 23, 2022

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Mar 17, 2022

Direct translation, not necessarily fully idiomatic. In preparation for
future improvements.

@jpsamaroo jpsamaroo added the multithreading Base.Threads and related functionality label Mar 17, 2022
base/partr.jl Outdated Show resolved Hide resolved
if (multiq_insert(task, task->prio) == -1)
failed = 1;
failed = 0;
JL_PROBE_RT_TASKQ_INSERT(jl_current_task->ptls, task);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Losing this is disappointing :) We will need to find a way to implement this from Julia efficiently.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we implement the logic of https://github.com/JuliaPerf/UProbes.jl directly in codegen?

Copy link
Member

@vchuravy vchuravy Mar 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but bpftrace would still not find the new probes. UProbes.jl works by outlining the probe to a shared library that bpftrace and co. can scan.

But this could work for code in the sysimage.

Direct translation, not necessarily fully idiomatic. In preparation for
future improvements.
@vtjnash vtjnash merged commit 6366f40 into master Mar 23, 2022
@vtjnash vtjnash deleted the jn/partr-julia branch March 23, 2022 17:19
@kpamnany
Copy link
Contributor

What was the performance impact of moving this?

@vtjnash
Copy link
Member Author

vtjnash commented Mar 23, 2022

What would you recommend for a benchmark?

@kpamnany
Copy link
Contributor

I have something for parallel queues somewhere. Will find and post.

@vtjnash
Copy link
Member Author

vtjnash commented Mar 23, 2022

After working around #44720, I see similar timing, but 5-10x less allocation with this PR on tkf's producer_consumer example in #43366

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multithreading Base.Threads and related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants