Boost logo

Boost :

Subject: Re: [boost] [chrono/date] conversion between concrete dates
From: Howard Hinnant (howard.hinnant_at_[hidden])
Date: 2013-05-11 14:16:34

On May 10, 2013, at 1:45 PM, "Vicente J. Botet Escriba" <vicente.botet_at_[hidden]> wrote:

> I have updated the test to use my current public interface.
> I'm getting the following:
> clang 3.2
> * empty field->serial ~0.15ns.
> * field->serial ~7.5ns.
> * empty serial->field ~0.65ns.
> * serial->field ~17.4ns.
> gcc-4.8.0
> * empty field->serial ~0.2ns.
> * field->serial ~10.2ns.
> * empty serial->field ~0ns.
> * serial->field ~20.6ns.

I've redone my timings in a more careful manner and am getting results much closer to yours now. I'm still only timing the conversion functions, but this time I put the functions in a separate translation unit. Previously I had the conversion functions and the test loop, all visible to the compiler within the same translation unit.

I also put in a "fake" conversion (out-of-line in the second translation unit) to measure the "empty" time. Here are my results:

* empty field->serial ~2.4ns.
* field->serial ~8.0ns.
* field->serial - empty field->serial ~5.6ns
* empty serial->field ~2.4ns.
* serial->field ~16.9ns.
* serial->field - empty serial->field ~14.5ns

And now my ratio of serial->field / field->serial is down to 2.6.

This is using clang++ -03 on a Core i5 2.8GHz.


Boost list run by bdawes at, gregod at, cpdaniel at, john at