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

Add benchmarking facilities to quantify performance of OSApp #330

Merged
merged 6 commits into from
May 15, 2021

Conversation

jmarrec
Copy link
Collaborator

@jmarrec jmarrec commented Apr 28, 2021

I've been trying to set up some benchmarking code for the past day, so we have something in place to:

I think I finally spat something that works

I am benchmarking the creation of the "Spaces > Surfaces" subtab, since this is a source of major slow down since you logically have way more surfaces than spaces (A rectangular space has 6...).

Here's a visualization that shows the current develop against #318

image

@@ -243,6 +243,8 @@ option(BUILD_PACKAGE "Build package" OFF)

option(BUILD_TESTING "Build testing" OFF)

option(BUILD_BENCHMARK "Build benchmarking targets" OFF)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new cmake option

Comment on lines 43 to 63
static void BM_SpacesSurfaces(benchmark::State& state) {

openstudio::Application::instance().application(true);

model::Model model = makeModelWithNSurfaces(state.range(0));

// Code inside this loop is measured repeatedly
for (auto _ : state) {
auto gridView = std::make_shared<SpacesSurfacesGridView>(false, model);
openstudio::Application::instance().application(true)->processEvents();
benchmark::DoNotOptimize(gridView);
};

state.SetComplexityN(state.range(0));

}

// This doesn't work, it goes [6, 8, 16...]
//BENCHMARK(BM_SpacesSurfaces)->RangeMultiplier(2)->Range(6, 6<<6)->Unit(benchmark::kMillisecond)->Complexity();
BENCHMARK(BM_SpacesSurfaces)->Arg(6)->Arg(12)->Arg(24)->Arg(48)->Arg(96)->Arg(192)->Arg(384)->Arg(768) // ->Arg(1536) // 1536 takes 89 secodns AFTER dan's improvements
->Unit(benchmark::kMillisecond)->Complexity();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actual parametric benchmark, with complexity calculation.

Note: In this case I'm trying to compare two very different branches, so I couldn't really do two static void BM_xxx functions to compare in the same, so there's just the one

jmarrec added 3 commits April 28, 2021 17:37
… it out later

```
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants