Comments (6)
will cacheing hashvalues provide a performance benefit?
from declarativelayout.
https://forums.swift.org/t/accepted-se-0206-hashable-enhancements/11675/18?u=scott (for how to cache hash values)
from declarativelayout.
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.
Implemented cacheing hashValues: #33
from declarativelayout.
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.
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)
- Add documentation about layout component returns HOT 1
- README should specify all constraints passed to activate should be unactivated HOT 7
- Should be examples of using other autolayout DSLs HOT 1
- Should not have constraint issues when moving views out of UIStackView HOT 4
- Support layout guides HOT 2
- Test how this affects layout using layout framework benchmark HOT 1
- Consider how to avoid recalculating constraint diffs for everything when making a change HOT 1
- Add default view creation to component methods HOT 1
- Add unit tests
- Allow specifying identifier for view HOT 1
- Consider how to get rid of all of the `component.` HOT 9
- Research how much of an improvement constraint diffing is HOT 6
- Update to Swift 5 HOT 1
- Musings on how to make it easier to control the flow of data for updating your UI HOT 8
- Awaiting WWDC HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from declarativelayout.