compile-time bignums

5 views
Skip to first unread message

Isaac Dupree

unread,
Apr 20, 2013, 12:31:03 AM4/20/13
to lase...@googlegroups.com
data_structures/compile_time_bignum.hpp

Converting units.hpp to use it for dim::ratio makes the files that
depend on units.hpp, collectively, compile 12% slower, by my
measurements (GCC 4.8.0, x86_64 Linux). The time cost is not in
#including the nearly-2000-line header, but in using it. I guess I
should commit the change to units.hpp anyway so we can have cubic
yoctometers and such? units identity() can't yet produce bignums
(values that doesn't fit in 64 bits) but we can hack that in in various
ways.

-Isaac

Isaac Dupree

unread,
Apr 20, 2013, 1:17:50 PM4/20/13
to lase...@googlegroups.com
On 04/20/2013 12:31 AM, Isaac Dupree wrote:
> data_structures/compile_time_bignum.hpp
>
> Converting units.hpp to use it for dim::ratio makes the files that
> depend on units.hpp, collectively, compile 12% slower,

Turns out I was wrong: most of that change was from changing the testing
code to be more verbose. Looking into changing the testing code to
compile faster instead of slower... :)

-Isaac

Isaac Dupree

unread,
Apr 21, 2013, 1:37:04 AM4/21/13
to lase...@googlegroups.com
General no-side-effects bignum work pushed to idupree master.

Change of units.hpp to use compile_time_bignum pushed on idupree branch
'zeptokelvins', including fixes so that Lasercake and
grand_structure_visualizer still build. It seems to work fine!! I left
the SI prefixes in grand_structure_visualizer as-is; you can fix them
how you like.

Let's talk on IM about how to make identity() return something sensible
for larger-than-64-bit ratios.

-Isaac
Reply all
Reply to author
Forward
0 new messages