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

Speedup code by moving things out of loops #22

Merged
merged 6 commits into from Aug 11, 2014

Conversation

Projects
None yet
1 participant
@leouieda
Copy link
Owner

leouieda commented Aug 11, 2014

There were a lot of trig functions being called inside loops. I moved some of them out of the loops for some speedups.

  • Benchmark
  • All tests pass
  • Changelog entry
  • Can be merged

leouieda added some commits Jul 23, 2014

Move calculations to outer loops for speed
Moved some things in grav_tess that could be calculated on outer loops
instead of the inner ones.
Precompute sin and cos of lat GLQ nodes
Gives a bit of a speedup as well.
@leouieda

This comment has been minimized.

Copy link
Owner

leouieda commented Aug 11, 2014

Ran the benchmark (master | speedup):

Computer specs           |  Computer specs
model name  : Intel(R)       |  model name  : Intel(R)
MemTotal:    3950824 kB  |  MemTotal:    3950824 kB
                 |  
Time spent on potential:     |  Time spent on potential:
4.02user 0.00system 0:04.03  |  2.02user 0.00system 0:02.03
0inputs+208outputs (0major+  |  0inputs+208outputs (0major+
                 |  
Time spent on gz:        |  Time spent on gz:
11.66user 0.00system 0:11.6  |  9.04user 0.00system 0:09.05
0inputs+208outputs (0major+  |  0inputs+208outputs (0major+
                 |  
Time spent on gzz:       |  Time spent on gzz:
49.16user 0.03system 0:49.2  |  39.59user 0.02system 0:39.6
0inputs+208outputs (0major+  |  0inputs+208outputs (0major+

leouieda added a commit that referenced this pull request Aug 11, 2014

Merge pull request #22 from leouieda/speedup
Speedup code by moving things out of loops

@leouieda leouieda merged commit 784d57b into master Aug 11, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@leouieda leouieda deleted the speedup branch Nov 20, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment