Giter VIP home page Giter VIP logo

Comments (4)

Kijewski avatar Kijewski commented on September 26, 2024 1

I think the biggest "offender" is my macro

macro_rules! unwrap {
    ($($tt:tt)*) => {
        match $($tt)* {
            Ok(value) => value,
            Err(_) => {
                #[allow(unconditional_panic)]
                let err = [][0];
                err
            }
        }
    }
}

If I replace it with ↓, then the compile time is about 4 times faster in the simple test I did.

pub(crate) const fn time_zone_ref_new(
    transitions: &'static [tz::timezone::Transition],
    local_time_types: &'static [tz::LocalTimeType],
    leap_seconds: &'static [tz::timezone::LeapSecond],
    extra_rule: &'static Option<tz::timezone::TransitionRule>,
) -> TimeZoneRef<'static> {
    match TimeZoneRef::new(transitions, local_time_types, leap_seconds, extra_rule) {
        Ok(value) => value,
        Err(_) => {
            #[allow(unconditional_panic)]
            let err = [][0];
            err
        },
    }
}

I'll test it properly in the next few days.

Changing the default features would be a breaking change. But I could use breaking change this to increase the msrv from 1.56 to 1.57, so I could use panic!() in time_zone_ref_new(). I'll think about it. :)

from tzdb.

lopopolo avatar lopopolo commented on September 26, 2024 1

This works great! thanks @Kijewski 🙇

I've gone ahead and upgraded to tzdb v0.6.0-pre.1.

from tzdb.

Kijewski avatar Kijewski commented on September 26, 2024

Please have a look if the path I took in tzdb = "0.6.0-pre.1" would work for you:

  • features = ["local"] enables function that use iana_time_zone.
  • If included, iana_time_zone is always used with feature = ["fallback"]

from tzdb.

Kijewski avatar Kijewski commented on September 26, 2024

Thank you for testing the pre-release! :) I just pushed the stable release 0.6.0.

from tzdb.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.