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

feat(Text): Measure Text on Dispatcher directly #896

Merged
merged 2 commits into from
Jul 27, 2017
Merged

Conversation

rozele
Copy link
Collaborator

@rozele rozele commented Nov 22, 2016

Prior to this change, layout was performed on any background thread. Because of this, we had to perform text measurement on the UI thread, which incurred many blocking calls to the UI. This change adds a secondary CoreApplicationView + Dispatcher in UWP and a secondary STA thread in WPF. This thread is characterized as the layout thread, which is only used from the UIManager. All text measurement calls can now be made directly without having to context switch to the main UI thread.

Fixes #106

@rozele
Copy link
Collaborator Author

rozele commented Mar 9, 2017

Closing and reopening to trigger CLA bot

@rozele rozele closed this Mar 9, 2017
@rozele rozele reopened this Mar 9, 2017
@msftclas
Copy link

msftclas commented Mar 9, 2017

@rozele,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@msftclas
Copy link

@rozele,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@rozele rozele changed the title feat(Text): (DO NOT MERGE) Measure Text on Dispatcher directly feat(Text): Measure Text on Dispatcher directly Jul 17, 2017
@codecov-io
Copy link

codecov-io commented Jul 17, 2017

Codecov Report

Merging #896 into master will decrease coverage by 0.07%.
The diff coverage is 0.56%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #896      +/-   ##
==========================================
- Coverage   32.01%   31.93%   -0.08%     
==========================================
  Files         257      257              
  Lines       18491    18538      +47     
  Branches     1557     1566       +9     
==========================================
+ Hits         5919     5920       +1     
- Misses      12425    12470      +45     
- Partials      147      148       +1
Impacted Files Coverage Δ
...ctNative.Shared/Bridge/Queue/MessageQueueThread.cs 52.19% <0%> (-9.9%) ⬇️
...Shared/Views/TextInput/ReactTextInputShadowNode.cs 0% <0%> (ø) ⬆️
...eactNative.Net46/Views/Text/ReactTextShadowNode.cs 0% <0%> (ø) ⬆️
...ive.Shared/Bridge/Queue/ReactQueueConfiguration.cs 0% <0%> (ø) ⬆️
...tWindows/ReactNative.Shared/Bridge/ReactContext.cs 34.37% <0%> (-2.79%) ⬇️
...ared/Views/TextInput/ReactPasswordBoxShadowNode.cs 0% <0%> (ø) ⬆️
...actNative.Shared/UIManager/UIViewOperationQueue.cs 4.59% <0%> (ø) ⬆️
...ws/ReactNative.Shared/UIManager/UIManagerModule.cs 9.93% <0%> (-1.18%) ⬇️
...tive.Shared/Bridge/Queue/MessageQueueThreadSpec.cs 83.33% <25%> (-16.67%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79b8ae4...e973d1c. Read the comment docs.

Prior to this change, layout was performed on any background thread. Because of this, we had to perform text measurement on the UI thread, which incurred many blocking calls to the UI. This change adds a secondary CoreApplicationView + Dispatcher in UWP and a secondary STA thread in WPF. This thread is characterized as the layout thread, which is only used from the UIManager. All text measurement calls can now be made directly without having to context switch to the main UI thread.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants