Giter Site home page Giter Site logo

Comments (10)

seanmonstar avatar seanmonstar commented on September 21, 2024

Yea, I noticed the slowdown when I added that header. strftime is not too fast in libtime. I filed rust-lang/rust#18556 to try to fix this.

from hyper.

reem avatar reem commented on September 21, 2024

In profiles it looks like most of the time is spent in rust_timegm, which is a C foreign function.

from hyper.

seanmonstar avatar seanmonstar commented on September 21, 2024

Ah, would that be because of the tm.to_utc() call?

from hyper.

reem avatar reem commented on September 21, 2024

Yes, I think.

from hyper.

seanmonstar avatar seanmonstar commented on September 21, 2024

Yea, so to_utc calls Tm.to_timespec(), which is calling rust_timegm: http://doc.rust-lang.org/src/time/home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libtime/lib.rs.html#327

from hyper.

reem avatar reem commented on September 21, 2024

I wonder if that will improve with runtime removal.

from hyper.

seanmonstar avatar seanmonstar commented on September 21, 2024

It seems like it's a waste of calls. The Tm is already in UTC, since the default is calling time::utc_now(). It notices the gmt_offset is 0, so it seems like it could just return itself quickly without touching the C function...

from hyper.

seanmonstar avatar seanmonstar commented on September 21, 2024

While that should be fixed in libtime, I could try checking for tm_gmtoff == 0 myself, and if so, no need to call to_utc().

from hyper.

seanmonstar avatar seanmonstar commented on September 21, 2024

The TmFmt patch was merged 2 days ago. With that and the #100 patch, does this improve things noticeably?

from hyper.

reem avatar reem commented on September 21, 2024

Yup, this is basically gone from the profiles.

from hyper.

Related Issues (20)

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.