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

Upgrade Google Benchmark to v1.5.0 #3386

Merged
merged 4 commits into from
Nov 12, 2019
Merged

Conversation

felipecrv
Copy link
Contributor

Followed the idea behind #2669 -- copy the google/benchmark repo contents instead of using git subtree.

I used git log lib/gbenchmark to see if there were ponyc-specific changes and found a commit from #2823. I cherry-picked it to get the remaining gbenchmark changes necessary. These changes should probably be merged to the upstream Google Benchmark repo to improve its OpenBSD support.

felipecrv and others added 4 commits November 10, 2019 14:06
This is based on looking at the changes in CMakeLists.txt
(Cherry-picked by @philix to bring back changes made to GBenchmark)
The MSVC build treats warning as errors and Google Benchmark
has a lossy conversion (from `double` to `int64_t`) which
triggers warning C4244.

```
benchmark_runner.cc(267): error C2220: warning treated as error - no 'object' file generated
benchmark_runner.cc(267): warning C4244: 'initializing': conversion from 'double' to 'benchmark::IterationCount', possible loss of data
```
@@ -616,7 +616,8 @@ libponyc.benchmarks.buildoptions += -DLLVM_BUILD_MODE=$(LLVM_BUILD_MODE)

libgbenchmark.buildoptions := \
-Wshadow -pedantic -pedantic-errors \
-Wfloat-equal -fstrict-aliasing -Wstrict-aliasing -Wno-invalid-offsetof \
-fstrict-aliasing -Wstrict-aliasing \
-Wno-invalid-offsetof -Wno-deprecated-declarations \
Copy link
Member

Choose a reason for hiding this comment

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

The change here is to address what exactly?

Copy link
Contributor Author

@felipecrv felipecrv Nov 12, 2019

Choose a reason for hiding this comment

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

Hi! These were intentional.

As the commit message says, these reflect the changes in gbenchmark's CMakeLists.txt.

I think they removed -Wfloat-equal because if you have -Wall, you don't have to explicitly enable this warning. Either that or they really want to == floats and know what they're doing.

And -Wno-deprecated-declarations was added because they deprecated the CSVReporter and they use -Werror like ponyc does so it becomes impossible to build gbenchmark without disabling the warning. See google/benchmark#608

-Wno-invalid-offsetof was moved to avoid mixing the -Wno- with other flags. This could probably be removed but it was here from the beginning so I kept it.

@SeanTAllen
Copy link
Member

This looks good to me, but I would want to know about the changes to our Makefile and get an explanation to make sure that each of the changes was done intentionally. Thanks, @philix.

If you can comment, we can get this merged.

@SeanTAllen
Copy link
Member

Awesome. Thanks, @philix.

@SeanTAllen SeanTAllen merged commit 6b455ff into ponylang:master Nov 12, 2019
@felipecrv felipecrv deleted the bench branch November 16, 2019 21:25
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.

3 participants