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

Performance for real time applications #165

Open
conicgames opened this issue Sep 23, 2020 · 2 comments
Open

Performance for real time applications #165

conicgames opened this issue Sep 23, 2020 · 2 comments
Labels
Status/1. Ready This issue has been confirmed and is ready to be worked on. Type/Question

Comments

@conicgames
Copy link

Hello!

I'm using CSharpMath for my Android game (Exponential Idle) and I really love it. However, when I use it to display many elements that changes every frame (~100ms), then game can get quite laggy. To avoid this issue, I started using a workaround where I split my LaTeX elements into 2 parts, a static part that doesn't change every frame, and the dynamic part. For the dynamic part, whenever I can, I create a native label using custom font with Computer Modern font characters (a mix of Italic and Regular), to get the same appearance as your library. It works quite well, but I find this solution to be really messy.

My question: Is there any way I can improve re-rendering performance in this context so I can continue only using your library? Text elements that change every frame usually look like "x_1 = 1.234e50", where the right side is dynamic.

Thanks!

@conicgames conicgames added Status/0. New This issue is new and is awaiting confirmation from the maintainers. Type/Question labels Sep 23, 2020
@Happypig375
Copy link
Collaborator

Happypig375 commented Sep 23, 2020

I think this can be improved by removing the unnecessary ToString -> reparse steps by the BindableProperties in MathView, mentioned at #141 (comment). However, this is necessary for Content and LaTeX bindable properties of MathView to sync up. This is hard to solve. Any ideas?

(Btw, can you share how do you promote your game? I'd like CSharpMath to reach a larger audience too)

@Happypig375 Happypig375 added Status/1. Ready This issue has been confirmed and is ready to be worked on. and removed Status/0. New This issue is new and is awaiting confirmation from the maintainers. labels Sep 23, 2020
@charlesroddie
Copy link
Collaborator

charlesroddie commented Nov 9, 2020

Are you using CSharpMath.Forms or CSharpMath.SkiaSharp? Are you making sure to avoid the BindableProperties and generating TextPainters manually?

CSharpMath/LayoutFarm.Typography should have some performance, but tweaks getting some simple dynamically changing tex at 60fps should be very easy.

We get some performance issues on layout and resizing of larger documents but that operation is much more intensive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status/1. Ready This issue has been confirmed and is ready to be worked on. Type/Question
Projects
None yet
Development

No branches or pull requests

3 participants