DigitalInBlue / Celero

C++ Benchmark Authoring Library/Framework
Other
824 stars 95 forks source link

Add User-Defined Measurements #127

Closed tinloaf closed 6 years ago

tinloaf commented 6 years ago

This is a first attempt at what I suggested in https://github.com/DigitalInBlue/Celero/issues/126

It has become a larger change than I expected, but that's also because I needed to change a lot in the printing code to accommodate for the new columns. I haven't yet added output of the user-defined measurements in the other two formats; this will follow if you like what I have so far.

There are some points which I'm not completely happy with, but for which I don't see a perfect solution:

Also, I didn't find any specification of what code style you prefer. I tried to go with what I found and keep it consistent.

DigitalInBlue commented 6 years ago

There is a lot of code here. Let me look at it for a bit. You did your pull request against "master", you should have done it against "develop" instead. (Following GitFlow). I am wondering out loud if making measurements generic from the start (of which, timing is the default option) is something that might work.

DigitalInBlue commented 6 years ago

Ok. I've looked this over. I think this is a reasonable implementation for now. It's a bit shoe-horned in, but the code just isn't built from the ground up to do this. I'm thinking about adding this concept to the next major version of Celero so that it can make arbitrary measurements. For now, I'm going to add your code in myself with some updates. For now, I'm going to reject your pull request, but look for this to be implemented on the Develop branch soon. I'll post a note here when that is done. (I'm working on it now.)

Thanks for this great contribution!

DigitalInBlue commented 6 years ago

This code was manually merged and updated onto the develop branch.

tinloaf commented 6 years ago

Great, thanks! :-) Do you know when this will make it into a release (one of my projects is depending on it, and it would be kind of bad if I depended on the development branch…)?