Closed ppisar closed 4 years ago
Yes, setting the no_range_check
key to true would do the trick. That said, I'd be happy to accept a PR to add time{gm,local}_modern_nocheck
variants.
It might be nice to add a more general way to pass options to a timelocal() or timegm() call especially if there will also be the functions added in #13.
So I looked into this some more. My benchmarks show a mere 3% increase when using the nocheck variants. So unless your code base consists mostly of calls to Time::Local
, using a nocheck variant won't make much difference.
I suspect that back in the day, the difference was much greater, but on modern systems it seems like it's not worth the effort.
Fair enough.
Time::Local recommends time_modern functions because of an unambiguous interpretation of the year value. Time::Local also provides time_nocheck functions that promise a faster code.
I'm missing an interface that is unambiguous and fast at the same time. Could you consider adding one? Or is setting $Time::Local::Options{no_range_check} and using time*_modern good enough?