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

TextBox performance issue (load times ~5x slower compared to WPF) #3336

Closed
Xarlot opened this issue Sep 26, 2020 · 5 comments
Closed

TextBox performance issue (load times ~5x slower compared to WPF) #3336

Xarlot opened this issue Sep 26, 2020 · 5 comments

Comments

@Xarlot
Copy link

Xarlot commented Sep 26, 2020

While investigating WinUI 3 Desktop performance I found that WinUI 3 TextBox seven times slower than in WPF. At first i thought that this is a well known bug with dependency property and marshalling however textblock is faster than in wpf.

Describe the bug

  1. The text box default template is too heavy, even with some elements loading on demand. Maybe it fast enough to touch-oriented apps when you have one or two text boxes on the form, but its too slow for LOB applications when you can have hundreds. Also, it is a building block for another more complex text editors, so it performance is extremelly important.

  2. I tried to simplify it template by removing all unnecesary elements except the scrollviewer with textboxview (you can look at it in the attached winui project), even so, textbox is slower several times than in wpf.

This bug is crucial for us. TextBox is a basic building block of any application. If we cant reach better performance than in predesessor, attracting new customers from previous platforms can be dificult.

Steps to reproduce the bug

  1. Run attached projects
  2. Click "click me" button
  3. In the title you will see the the last textbox loading time

App11.zip
WpfApplication13.zip

Expected behavior
WinUI 3 should be faster than wpf

Version Info
Package version 3.0.0-preview2.200713.0
AppModel WinUI 3 Desktop
OS Name Microsoft Windows 10 Enterprise
OS Version 10.0.19041 N/A Build 19041

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Sep 26, 2020
@ranjeshj
Copy link
Contributor

@bartekk8 as FYI

@BorzillaR
Copy link

I have checked performance in Preview 3.

See my results below

Platform Config
Wpf Release
WinUI p3 Release, x64
Wpf WinUI p3
First Load 796 3236
Second Load 659 3337

Sample projects:
3336-TextBoxStartUp.zip

@chrisglein
Copy link
Member

This assumption isn't going to be universally true:

WinUI 3 should be faster than wpf

While of course there is a desire to make WinUI3 the clear choice, the reality is that while the project is in transition there are going to be gaps. The closer comparison is going to be against UWP XAML rather than WPF, as WinUI3's origins are in UWP XAML. It'd be helpful to see a comparison of this scenario against UWP XAML to see if the increase is coming as a a result of WinUI3 or from WPF->UWP. As in is this a recent regression or a gap that needs to be closed with what WPF had.

Totally agree that TextBox performance is important and that apps with many TextBoxes should be viable. Just trying to correct assumptions that WinUI3 will be able to immediately meet/exceed those targets. There may be a bug here, or there may be something more substantial that's accrued over the years that needs to be analyzed.

@chrisglein chrisglein changed the title TextBox performance issue TextBox performance issue (load times ~5x slower compared to WPF) Jan 27, 2021
@chrisglein chrisglein removed the needs-triage Issue needs to be triaged by the area owners label Jan 27, 2021
@BorzillaR
Copy link

Update for Preview 4

image

@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants