Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Over 13000% slower than BCL and over 54000% slower than NodaTime #14

Closed
CShepartd opened this issue Feb 15, 2018 · 3 comments
Closed

Over 13000% slower than BCL and over 54000% slower than NodaTime #14

CShepartd opened this issue Feb 15, 2018 · 3 comments

Comments

@CShepartd
Copy link

CShepartd commented Feb 15, 2018

I checked how long will take timezone convert with BCL TimeZoneInfo, NodaTime and TZConvert in .Net Core. Just look

BCL TimeZoneInfo 1579,552 ms 
NodaTime 382,9316 ms 
TZConvert 207779,6301 ms  

h-h-how?

Normally

for (int i = 0; i < 1000000; i++)
{
    var a = TimeZoneInfo.ConvertTime(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById("Central European Standard Time"));
}
for (int i = 0; i < 1000000; i++)
{
    var a = Instant.FromDateTimeUtc(DateTime.UtcNow).InZone(DateTimeZoneProviders.Tzdb["Europe/Warsaw"]).ToDateTimeUnspecified();
}
for (int i = 0; i < 1000000; i++)
{
    var a = TimeZoneInfo.ConvertTime(DateTime.UtcNow, TZConvert.GetTimeZoneInfo("Europe/Warsaw"));
}

I thought this is a joke but no. Dont ask me about environment cuz i tested on several machines on Windows 10 x64. Just test yourself

Summary:
BCL TimeZoneInfo is over 130x faster than TZConvert
NodaTime is over 540x faster than TZConvert

@CShepartd CShepartd changed the title Dont call it "Lightweight library" Dont call it "Lightweight library" and better dont use it Feb 19, 2018
@mattjohnsonpint
Copy link
Owner

"Lightweight" typically refers to size, not perf. If you would like to revise your issue to be less hostile, I'd be happy to look into improving performance. Better yet, a PR would be appreciated.

Otherwise, all I'm hearing is "F*$% you, I don't like this" - and really that doesn't motivate me much.

@CShepartd
Copy link
Author

CShepartd commented Feb 28, 2018

"Lightweight" typically refers to size and performance (cuz it should be connected). I only showing a big problem about this project

and really that doesn't motivate me much

Publishing a library / nuget packege it's not about motivating or demotivating. It's also not about you. It's about this "monster" itself with is horrible slow. I can change name of this issue to better describe problem. This issue should be closed when come close to BCL (now slower than 13000%, just imagine it)

@CShepartd CShepartd changed the title Dont call it "Lightweight library" and better dont use it Over 13000% slower than BCL and over 54000% slower than NodaTime Feb 28, 2018
@mattjohnsonpint
Copy link
Owner

Closing due to nonconstructive nature of this discussion.

Repository owner locked as too heated and limited conversation to collaborators Mar 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants