Use a template free shim around quarterly.h
classes
#322
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To greatly improve compilation speed
Basically,
quarterly-year-quarter-day.cpp
needed every function to be templated on both the precision and the quarter start, which resulted in a massive explosion in the amount of template code that had to be generated.We don't really need templating on the quarter start, even though using a template in
quarterly.h
is technically correct (because it is part of the type definition). So this introduces a minimal shim around those classes that re-exposes them in a template free way.The shim doesn't expose everything from
quarterly.h
, only what is needed for the R API. We can expose more as needed.Essentially the template parameter is now a class member
quarterly_shim::year
. We went:On my 2018 Intel Mac, compilation time went down from 70s to 25s!
The internal switch over the quarter start types does make the quarterly type a little slower for some operations, but I think it is worth it: