Giter VIP home page Giter VIP logo

Comments (10)

mathieuprog avatar mathieuprog commented on September 26, 2024

Hi! Will look at it thank you!

from tz.

OldhamMade avatar OldhamMade commented on September 26, 2024

Hey there. Any updates on this? I've not had time myself to dig deeper, understandable if you haven't had time either.

from tz.

mathieuprog avatar mathieuprog commented on September 26, 2024

iex(1)> DateTime.now!("America/Argentina/Salta", Tz.TimeZoneDatabase)
#DateTime<2021-09-21 09:45:52.535000-03:00 -03 America/Argentina/Salta>

elixir --version
Erlang/OTP 22 [erts-10.7] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
Elixir 1.11.3 (compiled with Erlang/OTP 21)

Any thoughts? Can you run it now?

from tz.

mathieuprog avatar mathieuprog commented on September 26, 2024

Upgraded elixir/erlang, still working fine

Erlang/OTP 24 [erts-12.0] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Elixir 1.12.3 (compiled with Erlang/OTP 22)

from tz.

mathieuprog avatar mathieuprog commented on September 26, 2024

The error is cause by the option :reject_time_zone_periods_before_year. Removing this option will prevent the error.
That will be a quick solution before I fix it.
Note that I don't even know if this option is worth it with the newer version of Tz because I think it might make no difference memory-wise. It needs to be measured (I just don't know how yet). Also this option was more intended for embedded devices that have a very limited amount of memory.

from tz.

OldhamMade avatar OldhamMade commented on September 26, 2024

Ah yes, apologies, I should have mentioned that I'm using that option.

It's the main reason I'm looking to switch to Tz: right now I'm using Tzdata but I'm running in a memory-restricted environment. I'm looking for something with a smaller memory footprint, and I only care about dates in the future, so Tz with the reject option looked perfect for my needs.

from tz.

mathieuprog avatar mathieuprog commented on September 26, 2024

Are you able to measure the memory footprint?

from tz.

mathieuprog avatar mathieuprog commented on September 26, 2024

Fixed in 0.20.1

from tz.

mathieuprog avatar mathieuprog commented on September 26, 2024

Still interested to know if you can measure memory footprint:)

from tz.

OldhamMade avatar OldhamMade commented on September 26, 2024

Confirmed: fixed for me. Thanks @mathieuprog.

FYI, here are some results from a naïve benchmark for my use-case on my local machine:

Operating System: macOS
CPU Information: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Number of Available Cores: 16
Available memory: 64 GB
Elixir 1.12.0
Erlang 24.0.1

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 30 s
memory time: 30 s
parallel: 4
inputs: none specified
Estimated total run time: 2.07 min

Benchmarking Tz...
Benchmarking Tzdata...

Name             ips        average  deviation         median         99th %
Tz            8.82 K      113.38 μs    ±52.02%       77.99 μs      324.99 μs
Tzdata        4.88 K      204.99 μs    ±17.63%      196.99 μs      352.99 μs

Comparison:
Tz            8.82 K
Tzdata        4.88 K - 1.81x slower +91.61 μs

Memory usage statistics:

Name           average  deviation         median         99th %
Tz            13.91 KB     ±0.09%       13.90 KB       13.95 KB
Tzdata        99.90 KB     ±0.09%       99.86 KB      100.09 KB

Comparison:
Tz            13.90 KB
Tzdata        99.90 KB - 7.18x memory usage +86.00 KB

My config is:

config :elixir, :time_zone_database, Tz.TimeZoneDatabase
config :tz, reject_time_zone_periods_before_year: 2019

from tz.

Related Issues (18)

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.