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

How to test performance? #22

Open
xtuzy opened this issue Mar 3, 2023 · 7 comments
Open

How to test performance? #22

xtuzy opened this issue Mar 3, 2023 · 7 comments

Comments

@xtuzy
Copy link
Owner

xtuzy commented Mar 3, 2023

I always worry SharpConstraintLayout can't be used in real word, because i don't know the performance, test in core is fast, but in ui, it need calculate more things, i don't know how to test it. I only know, when i resize Windows app, flow test like slow.

Goolgle use androidx.constraintlayout , i believe it meet needs. I try to add a framerate label and a androidx.constraintlayout
flow test to compare with sharpconstraintlayout at a5ec59b, get result:

sharex-20230303104301.mp4

We can see when resize window of app that run in Windows subsystem for Android, androidx.constraintlayout and sharpconstraintlayout all get low framerate. But when change child, framerate is ok.

@xtuzy
Copy link
Owner Author

xtuzy commented Mar 4, 2023

Maui framerate < 60 when there are 200 controls:

sharex-20230304111633.mp4

@xtuzy
Copy link
Owner Author

xtuzy commented Mar 4, 2023

SharpConstraintLayout.Native is ok when there are 200 controls:

sharex-20230304120657.mp4

@xtuzy
Copy link
Owner Author

xtuzy commented Apr 20, 2023

when use net6, i see log show measure many times, tonight i try use net7, measure little times, tomorrow i will test it.
another i find i can directly load measure method to calculate time of measure, maybe i can use it to compare other layout

@xtuzy
Copy link
Owner Author

xtuzy commented Apr 23, 2023

200个控件在flow里慢的原因主要是重复布局了, 可能导致重复布局的因素是文本输入控件的重复布局

  1. 我因为Entry在iOS上输入时显示省略号, 在TextChange里刷新了View, log中更改文本时显示两次布局过程
  2. Editor控件输入时导致多次布局, 暂且不知道为什么

@xtuzy
Copy link
Owner Author

xtuzy commented Apr 25, 2023

v2.2.0

  • remove entry in flow performance test, when entry/editor is wrapcontent, will generate many bug. when we use entry or editor, usually will constrain it.
  • i also obsolete baseline api, not calculate it will save time

@xtuzy
Copy link
Owner Author

xtuzy commented Apr 25, 2023

I see log always have some bug about measure order, breakpoint sometimes not work, I feel best way test it is use a complex collectionview, see fps when fast scroll.

@xtuzy
Copy link
Owner Author

xtuzy commented Jul 4, 2023

When i use ConstraintLayout in https://github.com/xtuzy/MauiUICollectionView, I know a way to test performance, use IView.Measure can get time fo measure.

Now test code see 49a27fe , it use a CollectonView, use Official Layout and ConstraintLayout to layout item, record time of measure.
Result: Official Layout faster than SharpConstraintLayout

sharex-20230705110829
sharex-20230705110942
sharex-20230705110958

I run it on android old phone, it scroll well:
https://twitter.com/H_N_B_D_D/status/1676483931967979520?t=8Qk2XL0iefq5Ka31NvL1Ng&s=19

One bug is it is slow on start, use official layout also.

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

No branches or pull requests

1 participant