-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Internal speedup for calculating line opacities #167
Conversation
…_line_at_nu to make use of that
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #167 +/- ##
==========================================
+ Coverage 68.09% 68.28% +0.18%
==========================================
Files 31 31
Lines 1163 1154 -9
==========================================
- Hits 792 788 -4
+ Misses 371 366 -5 ☔ View full report in Codecov by Sentry. |
*beep* *bop* All benchmarks: All benchmarks:
before after ratio
[eba2b6dc] [15694266]
349±4ms 332±5ms 0.95 run_stardis.BenchmarkStardis.time_calc_alpha
11.9±0.06ms 11.9±0.06ms 1.00 run_stardis.BenchmarkStardis.time_raytrace
1.68±0.01s 1.66±0s 0.99 run_stardis.BenchmarkStardis.time_run_stardis
|
I changed some code to use vectorization and appropriate broadcasting to eliminate some for loops. For an 1000 angstrom wide spectrum with 0.01 angstrom wide bins, this reduces the calculation time by a factor of ~2. Considering that this is most computationally expensive part of the code, this offers a substantial speedup to stardis.
This change doesn't seem to show much in the benchmarks because we use a very small simulation in that case. This mainly gives significant speedups for large simulations that calculate many lines at many frequency bins.