Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set thread-local calendars and calendar prototype for RegularTimePeriod #171

Merged
merged 2 commits into from
Nov 15, 2020

Commits on Oct 31, 2020

  1. Allow to use thread-local calendars and prototype

    A thread-local calendar can be set with
    RegularTimePeriod.setThreadLocalCalendarInstance() to use for pegging
    various RegularTimePeriod instances, avoiding the need to create a new
    calendar instance every time one is needed (this creates huge load on GC
    and high memory consumption in scenarios where there are many instances).
    
    To avoid setting an instance for every thread, a global prototype can be
    set with RegularTimePeriod.setCalendarInstancePrototype(), which then
    will be automatically cloned and cached by every thread.
    
    Calendar instances are now obtained with
    RegularTimePeriod.getCalendarInstance(), which resorts to spamming new
    default calendar instances every time (old behavior) if neither
    a thread-local instance nor a prototype were set.
    stachenov committed Oct 31, 2020
    Configuration menu
    Copy the full SHA
    2aa60dd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    24d76de View commit details
    Browse the repository at this point in the history