Giter Site home page Giter Site logo

Comments (3)

dlew avatar dlew commented on July 22, 2024

Interesting!

a) I've never conducted any performance tests but it'd be interesting to compare loading via the resource system vs. the classloader, especially since the commit you linked is directly related to that.

b) I wonder if this would mean the library wouldn't have to include the tzdata by having a custom TzdbZoneRulesProvider that calls setUseCaches(false).

The performance hit might be reason enough not to use it, if it means that you're adding a couple hundred milliseconds during initialization.

from threetenabp.

JakeWharton avatar JakeWharton commented on July 22, 2024

I did a few benchmarks the weekend before last and got around 1-2ms of loading time. I did not bother comparing with the jar resources version due to Dan's blog post and approach on the Joda variant.

As to performance in general, I think I might be more interested in compiling our own TZDB format which allows us to lazy-load individual pieces from it as they're used. I haven't looked into much, just wanted to get this library up and start experimenting.

from threetenabp.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 22, 2024

I did some comparison a few days ago, of the most simple way for Joda vs ThreeTen vs ThreeTenABP :

image

Each is a different app, of course. Tested on Pixel 2 with Android P, so currently there isn't any newer version of Android, and it's quite a good device too...

What I did is to init the library (if needed) , and get the current time, twice. I measured the time of each of those things.

I don't know about memory usage, but it seems that Joda and ThreeTenABP have better speed of first usage than the normal ThreeTen library.

When using the Android framework, though, it takes ~33ms for first call (of "LocalDateTime.now()") to finish. So if your app has minSdk of at least 26, you should consider using the Android framework instead. But even then, I think it has a disadvantage as time zones aren't updated, right? So I guess there is still need of using a library (made request here) ... :(

Can anyone else verify the results ?

Attached here sample projects for each of those.

allTests.zip

from threetenabp.

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.