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

Add function_ref #337

Closed
wants to merge 3 commits into from
Closed

Add function_ref #337

wants to merge 3 commits into from

Conversation

nsavoire
Copy link
Collaborator

@nsavoire nsavoire commented Oct 24, 2023

Based on PR #336

Add https://github.com/zhihaoy/nontype_functional as third party, this provides a function_ref implementation (non-owning cheap alternative to std::function).

@nsavoire nsavoire self-assigned this Oct 24, 2023
@nsavoire nsavoire changed the title Add https://github.com/zhihaoy/nontype_functional as third party Add function_ref Oct 24, 2023
@nsavoire nsavoire force-pushed the nsavoire/add_function_ref branch from 82d06db to 0feeb8c Compare October 24, 2023 14:04
This allows to removing dependency on ddprof::Parser for profiling lib
and some unit tests.
Git commit: 83ba1aebdb22f9aa806166467da76bf04e0b07c8
@nsavoire nsavoire force-pushed the nsavoire/remove_dependencies_on_ddprof_parser branch from 000ddde to c485204 Compare October 24, 2023 14:14
@nsavoire nsavoire force-pushed the nsavoire/add_function_ref branch from 0feeb8c to 66f9c5b Compare October 24, 2023 14:14
@pr-commenter
Copy link

pr-commenter bot commented Oct 24, 2023

Benchmark results for collatz

Parameters

Baseline Candidate
config baseline candidate
profiler-version ddprof 0.15.0+99326392.22228515 ddprof 0.15.0+66f9c5b0.22279541

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean execution_time
scenario:ddprof -S bench-collatz --preset cpu_only collatz_runner.sh unsure
[-50.198ms; -1.137ms] or [-1.289%; -0.029%]

@pr-commenter
Copy link

pr-commenter bot commented Oct 24, 2023

Benchmark results for BadBoggleSolver_run

Parameters

Baseline Candidate
config baseline candidate
profiler-version ddprof 0.15.0+99326392.22228515 ddprof 0.15.0+66f9c5b0.22279541

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean execution_time
scenario:ddprof -S bench-bad-boggle-solver BadBoggleSolver_run work 1000 same

@nsavoire nsavoire marked this pull request as draft October 24, 2023 16:19
@r1viollet
Copy link
Collaborator

Where do we need this ?

@nsavoire
Copy link
Collaborator Author

Where do we need this ?

In an earlier version of my PR to reduce allocation event size, I was passing a callback to save_context to reserve size in ring buffer. function_ref allowed to pass a capturing lambda without the extra cost associated to std::function.
Since I changed my implementation, I do not need this anymore, I changed the PR status to draft.

Base automatically changed from nsavoire/remove_dependencies_on_ddprof_parser to main October 26, 2023 20:06
@r1viollet
Copy link
Collaborator

Where do we need this ?

In an earlier version of my PR to reduce allocation event size, I was passing a callback to save_context to reserve size in ring buffer. function_ref allowed to pass a capturing lambda without the extra cost associated to std::function. Since I changed my implementation, I do not need this anymore, I changed the PR status to draft.

Thanks for leaving as draft. I was actually considering std::functions recently and was not sure of the cost.

@nsavoire nsavoire closed this Nov 20, 2023
@nsavoire nsavoire deleted the nsavoire/add_function_ref branch November 20, 2023 14:34
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