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
Add benchmarking of regStep vs spliceFunction #300
Comments
I added simple tests to the Benchmarks package. I ran each test 10 times and compared the computation times for each call of the block "Auxiliary2 code", which I think includes the function calls. The results showed quite some variations, with the regStep function seeming to be a bit faster than the splice function on average:
Results are in us per call of block. |
Because |
Did you verify if the function is inlined? This could create a speed up. You can write An algorithm that loops over the function. That makes it easier to compare performance. Op 21-jul.-2015 om 01:30 heeft Michael Wetter <notifications@github.commailto:notifications@github.com> het volgende geschreven: Because regStep is on average about 8% faster, I think we should use regStep in Utilities.Math. — |
That is a good point, I had originally not taken that into account. Now I duplicated both |
@marcusfuchs : Did you use |
You're right, I changed it to |
@marcusfuchs The implementation seems correct. Note that "Inline" is only a suggestion for the translator. Maybe because spliceFunction is larger, Dymola decides not to inline the code. Next, I suggest to use regStep where we now use spliceFunction, and I can run a few tests on the larger models of the Buildings library, preferably after #301 is corrected |
From my experience with inlining Dymola will only inline the function if the function body contains only one equation (including parameters, i.e. no parameters should exist). This is the case for
|
In the last comparison,
|
I added a Python script that compares |
I think we have a clear winner :) Also I think that the actual computation time difference may be large than what is indicated by these box plots since there is a lot of overhead for compiling, initialisation, etc? |
Maybe these two should be moved to
|
For #300. As regStepInline was found to be the implementation with best performance, this is moved from Experimental into the Utilities package.
@marcusfuchs : I started implementing your changes. I merged the relevant 3 files (not the benchmarks) to a new branch called |
In some cases, nonlinear equations are replaced by linear equations after using |
For FMU-Paper.
The text was updated successfully, but these errors were encountered: