You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's the output for the program below on my machine (Dart 3.0.5):
With UTC DateTime: 20 ms
With local DateTime: 26 ms
With TZDateTime: 61 ms
Both my local tz and the TZDateTime are in the same America/New_York time zone. Can you think of a way to reduce the performance gap between DateTime and TZDateTime? For reference, the equivalent Rust code for TZDateTime runs in 16 ms. That indicates that the Dart's local DateTime is <2x (OK, acceptable), but the TZDateTime 5x is on the slow side.
Thank you for making & maintaining this package. It is absolutely a must.
Tony
main() {
initializeTimeZones();
var location =getLocation('America/New_York');
constH1=constDuration(hours:1);
var sw =Stopwatch()..start();
var dt =DateTime.utc(2000);
for (var i =0; i <201624; i++) {
dt = dt.add(H1);
}
sw.stop();
print('With UTC DateTime: ${sw.elapsedMilliseconds} ms');
sw.start();
dt =DateTime(2000);
for (var i =0; i <201624; i++) {
dt = dt.add(H1);
}
sw.stop();
print('With local DateTime: ${sw.elapsedMilliseconds} ms');
sw.start();
dt =TZDateTime(location, 2000);
for (var i =0; i <201624; i++) {
dt = dt.add(H1);
}
sw.stop();
print('With TZDateTime: ${sw.elapsedMilliseconds} ms');
}
The text was updated successfully, but these errors were encountered:
Hi,
Here's the output for the program below on my machine (Dart 3.0.5):
With UTC DateTime: 20 ms
With local DateTime: 26 ms
With TZDateTime: 61 ms
Both my local tz and the TZDateTime are in the same America/New_York time zone. Can you think of a way to reduce the performance gap between DateTime and TZDateTime? For reference, the equivalent Rust code for TZDateTime runs in 16 ms. That indicates that the Dart's local DateTime is <2x (OK, acceptable), but the TZDateTime 5x is on the slow side.
Thank you for making & maintaining this package. It is absolutely a must.
Tony
The text was updated successfully, but these errors were encountered: