Skip to content

Commit

Permalink
Force inline gregorian::date::date(special_values) to improve perf
Browse files Browse the repository at this point in the history
At least GCC 6.5.0, 7.4.0 and 8.3.0 fail to inline
gregorian::date::date(special_values) when constructing
posix_time::ptime and possibly other types. This leads to large
performance overheads for a operation that should ideally be a store of
a constant to some memory location.
  • Loading branch information
p12tic committed Feb 3, 2020
1 parent 29bb209 commit b861d0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/boost/date_time/gregorian/greg_date.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace gregorian {
date_time::date<date,gregorian_calendar, date_duration>(rhs)
{}
//! Constructor for infinities, not a date, max and min date
explicit date(special_values sv):
BOOST_FORCEINLINE explicit date(special_values sv):
date_time::date<date, gregorian_calendar, date_duration>(date_rep_type::from_special(sv))
{
if (sv == min_date_time)
Expand Down

0 comments on commit b861d0e

Please sign in to comment.