enhancement request local_date_time::check_dst

Open
#78 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
performance

Research direction

Start at date_time/local_time/local_date_time.hpp:199 and inspect how d.year(), dst_local_start_time(), and dst_local_end_time() are used by check_dst. Compare the current repeated evaluations with the reported caching approach, then verify that date-time behavior is unchanged and the performance improvement is measurable.

Written by the indexing model from the issue text.

Description

enhancement

Release: 1.64
At date_time/local_time/local_date_time.hpp:199 we have:

        tz->dst_local_start_time(d.year()).date(),
        tz->dst_local_start_time(d.year()).time_of_day(),
        tz->dst_local_end_time(d.year()).date(),
        tz->dst_local_end_time(d.year()).time_of_day(),
        tz->dst_offset()

We did some performance evaluation and found that caching d.year(), dst_local_start_time() and dst_local_end_time() improved performance substantially.

Dominant language
C++
Stars
70
Forks
99
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/date_time

All issues in boostorg/date_time

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.