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

Speed up transform!(grid, f) #675

Merged
merged 1 commit into from
Apr 11, 2023
Merged

Speed up transform!(grid, f) #675

merged 1 commit into from
Apr 11, 2023

Conversation

KnutAM
Copy link
Member

@KnutAM KnutAM commented Apr 11, 2023

Speeds up transform! and removes allocations

using Ferrite, BenchmarkTools
grid = generate_grid(Quadrilateral, (200,200));
f(x::Vec{2}) = x*1.01;
gtmp = deepcopy(grid); @btime transform!($gtmp, $f); # PR:  30.600 μs (0 allocations: 0 bytes)
gtmp = deepcopy(grid); @btime transform!($gtmp, $f); # master: 86.100 μs (2 allocations: 631.36 KiB)

Note: It disallows AbstractGrid as it assumes the grid's nodes are stored as Node and that the grid has the field grid.nodes.

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (247d7c3) 93.45% compared to head (a75ea52) 93.44%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #675      +/-   ##
==========================================
- Coverage   93.45%   93.44%   -0.01%     
==========================================
  Files          29       29              
  Lines        4263     4259       -4     
==========================================
- Hits         3984     3980       -4     
  Misses        279      279              
Impacted Files Coverage Δ
src/Grid/grid.jl 90.26% <100.00%> (-0.11%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fredrikekre fredrikekre merged commit aa26130 into master Apr 11, 2023
@fredrikekre fredrikekre deleted the kam/fasttransform branch April 11, 2023 06:58
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.

3 participants