markusfisch / ShaderEditor

Android app to create GLSL shaders and use them as live wallpaper
https://play.google.com/store/apps/details?id=de.markusfisch.android.shadereditor
MIT License
924 stars 137 forks source link

editor gets slower #125

Open Nxrix opened 1 year ago

Nxrix commented 1 year ago

Always editor gets slower when editing big file also when the preview is so fast and highlights are disabled.

IMG_20221206_224613

markusfisch commented 1 year ago

Well, resources are not endless 😉

If the shader runs much slower than ~50 fps, it is better to run it in its own window instead of in the background. You can change this by picking a different Run Mode in settings.

The editor is essentially Android's EditText control, extended with some regular expressions for syntax highlighting. Unfortunately, this control does not handle large amounts of text very well 😬 The only option to improve it a little bit is to disable syntax highlighting for large amounts of text at the moment. Sorry.

Nxrix commented 1 year ago

i tried all of those things you said but still its slow 😕

Asmageddon commented 1 year ago

The only option to improve it a little bit is to disable syntax highlighting for large amounts of text at the moment. Sorry.

What about adaptively adjusting the highlight/shader update delays as things get slower?

AntonPieper commented 1 year ago

Is the editing of text slow, the scroll slow, or the lag due to compilation?

RpxdYTX commented 7 months ago

I'd really love to be able to load files into the editor, this way i could edit with a faster editor and import to this app to try the shader out

AntonPieper commented 7 months ago

@RpxdYTX is that a performance regression since last year, or has the slowness always been an issue for you? Because I have implemented lexer-based highlighting for version 2.32.0, which should improve performance of code highlighting. Of course, this should only improve text drawing performance, not shader compilation and overall shader performance. I am just wondering if I somehow made the editor slower for some.

RpxdYTX commented 7 months ago

It has always been an issue, sometimes i need to stop writing code, wait for it to appear on screen and then do something like Shift + Letter to write things like gl_FragColor.