Giter Site home page Giter Site logo

Comments (6)

ScottRobbins avatar ScottRobbins commented on August 19, 2024

will cacheing hashvalues provide a performance benefit?

from declarativelayout.

ScottRobbins avatar ScottRobbins commented on August 19, 2024

https://forums.swift.org/t/accepted-se-0206-hashable-enhancements/11675/18?u=scott (for how to cache hash values)

from declarativelayout.

ScottRobbins avatar ScottRobbins commented on August 19, 2024

If I immediately cache the hash value of layout constraints, can I do the constraint diffing on a different thread while the other view hierarchy stuff is running?

My guess is that this won't help much. I should also see how much time is actually spent on constraint diffing vs the rest of it. It may be a good idea to make a chart of how much time is spent for some specific example on each part. maybe play with os_signpost for that.

from declarativelayout.

ScottRobbins avatar ScottRobbins commented on August 19, 2024

Implemented cacheing hashValues: #33

from declarativelayout.

ScottRobbins avatar ScottRobbins commented on August 19, 2024

If I immediately cache the hash value of layout constraints, can I do the constraint diffing on a different thread while the other view hierarchy stuff is running?

No, because the actual equatable work relies on the main thread to access the real views to compare instances.

I'm still unsure if this applies to diffing since I won't be manipulating UIViews in the background, just checking if one is equal to another. Assuming that testing equality in the background is thread safe, will it still print shit in the console anyway? If so, that may be enough to not make it a good solution, as people will think it is unsafe.

I suppose I could probably also grab its layer, which is thread safe, to do comparing in the background. but in all honesty there probably aren't enough constraints to diff to make the overhead of context switching worth it.

from declarativelayout.

ScottRobbins avatar ScottRobbins commented on August 19, 2024

Since 0.9.0 might change the model of how this whole thing works anyway, I'm not going to do more optimizations in 0.8.0

from declarativelayout.

Related Issues (16)

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.