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

Switch to ComponentArrays #167

Merged
merged 8 commits into from
Nov 3, 2023

Conversation

ChrisRackauckas
Copy link
Contributor

Keep life simple man. ComponentArrays keeps a hierarchical abstract structure with an underlying vector, and thus works much better with many operations in terms of performance, but also works with LinearAlgebra in nicer ways than a MultiScaleArray. Given that the size of the state is constant, this is a much simpler thing to use.

Also, it's faster. On Bukyko-Sellers:

using BenchmarkTools
@btime solve(prob, Tsit5(), save_everystep=false);
# Before:
# 1.141 ms (2150 allocations: 60.66 KiB)
# After:
# 11.917 μs (145 allocations: 12.66 KiB)

Keep life simple man. ComponentArrays keeps a hierarchical abstract structure with an underlying vector, and thus works much better with many operations in terms of performance, but also works with LinearAlgebra in nicer ways than a MultiScaleArray. Given that the size of the state is constant, this is a much simpler thing to use.

Also, it's faster. On Bukyko-Sellers:

```julia
using BenchmarkTools
@Btime solve(prob, Tsit5(), save_everystep=false);
# Before:
# 1.141 ms (2150 allocations: 60.66 KiB)
# After:
# 11.917 μs (145 allocations: 12.66 KiB)
```
Copy link

codecov bot commented Nov 2, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5db4865) 74.51% compared to head (f532fc5) 74.42%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #167      +/-   ##
==========================================
- Coverage   74.51%   74.42%   -0.10%     
==========================================
  Files           9        9              
  Lines        1126     1122       -4     
==========================================
- Hits          839      835       -4     
  Misses        287      287              
Files Coverage Δ
src/Decapodes.jl 100.00% <ø> (ø)
src/simulation.jl 90.90% <100.00%> (-0.11%) ⬇️

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

@ChrisRackauckas
Copy link
Contributor Author

🎉

@jpfairbanks jpfairbanks merged commit 25cb131 into AlgebraicJulia:main Nov 3, 2023
9 checks passed
@ChrisRackauckas ChrisRackauckas deleted the componentarrays branch November 3, 2023 13:54
@lukem12345 lukem12345 mentioned this pull request Nov 6, 2023
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