Comments (10)
Hi! Will look at it thank you!
from tz.
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.
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.
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.
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.
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.
Are you able to measure the memory footprint?
from tz.
Fixed in 0.20.1
from tz.
Still interested to know if you can measure memory footprint:)
from tz.
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 (20)
- Allow Tz.WatchPeriodically to accept and call a function when triggered. HOT 2
- Is it possible to make the custom data dir a runtime value? HOT 8
- Zone abbreviation lookup inconsistent (EST and EDT) HOT 5
- WatchPeriodically keeps complaining about a new version HOT 19
- Add option to force the use of a specific iana version? HOT 1
- Error with Iana version 2023a HOT 5
- (RuntimeError) unexpected case: 3 ongoing rules for rule "Palestine" (2023c) HOT 3
- Logger.warn/1 is deprecated on Elixir 1.15 in favour of Logger.warning/2 HOT 2
- Release crashes when configuring data_dir at runtime HOT 7
- print a warning but allow the app to start if there's an HTTP error HOT 2
- Time converting and back is not symmetrical HOT 2
- required files missing in CI HOT 13
- Warnings for behaviour not implented in Elixir 1.17 HOT 1
- 2024b data file causes parsing error HOT 3
- Failing to start `TzUpdatePeriodically` HOT 10
- GenServer :tzdata_release_updater terminating * 2nd argument: not a tuple HOT 1
- Support for Timex to replace Tzdata HOT 6
- Avoid making requests to https://data.iana.org for tz data updates
- Out of memory when recompiling time zone periods on a memory-limited system HOT 17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tz.