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

Implement _zeros and _ones utils #135

Merged
merged 7 commits into from
Nov 25, 2024
Merged

Implement _zeros and _ones utils #135

merged 7 commits into from
Nov 25, 2024

Conversation

mikeingold
Copy link
Collaborator

@mikeingold mikeingold commented Nov 25, 2024

Changes

  • Implements _zeros and _ones utility functions. These act like Base.zeros and Base.ones, respectively, but return NTuples to eliminate some allocations.
    • Improves performance for HAdaptiveCubature integrals, up to about 2.7x for particularly simple integrals.

Notes

@mikeingold mikeingold added the enhancement New feature or request label Nov 25, 2024
@mikeingold mikeingold self-assigned this Nov 25, 2024
Copy link
Contributor

github-actions bot commented Nov 25, 2024

Benchmark Results

main f1952e3... main/f1952e3019cef7...
Differentials/Differential 0.241 ± 0.0019 μs 0.24 ± 0.0019 μs 1
Differentials/Jacobian 0.206 ± 0.001 μs 0.206 ± 0.001 μs 1
Integrals/Meshes.BezierCurve/Scalar GaussKronrod 23 ± 0.066 ms 23 ± 0.049 ms 1
Integrals/Meshes.BezierCurve/Scalar GaussLegendre 22 ± 0.063 ms 22 ± 0.059 ms 1
Integrals/Meshes.BezierCurve/Scalar HAdaptiveCubature 23.2 ± 0.086 ms 23.2 ± 0.047 ms 1
Integrals/Meshes.BezierCurve/Vector GaussKronrod 23 ± 0.054 ms 23 ± 0.057 ms 1
Integrals/Meshes.BezierCurve/Vector GaussLegendre 22 ± 0.054 ms 22 ± 0.034 ms 1
Integrals/Meshes.BezierCurve/Vector HAdaptiveCubature 23.2 ± 0.045 ms 23.2 ± 0.092 ms 1
Integrals/Meshes.Segment/Scalar GaussKronrod 1.19 ± 0.019 μs 1.38 ± 0.013 μs 0.865
Integrals/Meshes.Segment/Scalar GaussLegendre 0.0556 ± 0.0011 ms 0.0549 ± 0.00094 ms 1.01
Integrals/Meshes.Segment/Scalar HAdaptiveCubature 4.54 ± 0.07 μs 1.75 ± 0.067 μs 2.59
Integrals/Meshes.Segment/Vector GaussKronrod 3.48 ± 0.051 μs 3.45 ± 0.069 μs 1.01
Integrals/Meshes.Segment/Vector GaussLegendre 0.0682 ± 0.0011 ms 0.0671 ± 0.0011 ms 1.02
Integrals/Meshes.Segment/Vector HAdaptiveCubature 7.46 ± 0.15 μs 4.63 ± 0.086 μs 1.61
Integrals/Meshes.Sphere/Scalar GaussKronrod 0.0855 ± 0.00046 ms 0.0859 ± 0.0019 ms 0.995
Integrals/Meshes.Sphere/Scalar GaussLegendre 12.2 ± 0.12 ms 12.2 ± 0.14 ms 0.998
Integrals/Meshes.Sphere/Scalar HAdaptiveCubature 0.0633 ± 0.00042 ms 0.0603 ± 0.00028 ms 1.05
Integrals/Meshes.Sphere/Vector GaussKronrod 0.119 ± 0.001 ms 0.126 ± 0.0094 ms 0.938
Integrals/Meshes.Sphere/Vector GaussLegendre 13.6 ± 0.45 ms 13.7 ± 1.2 ms 0.988
Integrals/Meshes.Sphere/Vector HAdaptiveCubature 0.113 ± 0.0014 ms 0.11 ± 0.0013 ms 1.03
time_to_load 1.4 ± 0.016 s 1.39 ± 0.023 s 1.01

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.90%. Comparing base (1bccd58) to head (f1952e3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #135      +/-   ##
==========================================
+ Coverage   95.81%   95.90%   +0.08%     
==========================================
  Files          17       17              
  Lines         287      293       +6     
==========================================
+ Hits          275      281       +6     
  Misses         12       12              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@mikeingold mikeingold marked this pull request as ready for review November 25, 2024 05:24
Copy link
Member

@JoshuaLampert JoshuaLampert left a comment

Choose a reason for hiding this comment

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

Looks good. I only have one minor comment.

src/specializations/Plane.jl Outdated Show resolved Hide resolved
Co-authored-by: Joshua Lampert <[email protected]>
Copy link
Member

@JoshuaLampert JoshuaLampert left a comment

Choose a reason for hiding this comment

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

Thanks!

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@JoshuaLampert JoshuaLampert merged commit 0cd335d into main Nov 25, 2024
12 checks passed
@JoshuaLampert JoshuaLampert deleted the tuples branch November 25, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants