Open aiaimimi0920 opened 1 month ago
@chairfull Is there a solution to this problem? Thanks
I'm going to check later if caching all the Regex stuff saves some time, but at the moment this problem is not a priority for my projects.
ok,thanks your help
I also wanted to add to this, I'm using RichTextLabel2 for floating damage. Instantiating takes about 200ms for each label.
@aiaimimi0920 @SaltyByte one expensive feature is font_auto_setup
which might be generating 3 fonts each time.
In your instanced scene try setting font_auto_setup = false
, clearing Theme Overides > Fonts > Bold, Italics, Bold Italics, and then saving.
I'll try rewriting this later to save the fonts to disk.
Hey @chairfull i did what you've suggested, it seems like it helps but theres still lag. From avg of 200ms delay it is now 50ms of delay, but to be fair that is still quite a lot. For reference, using regular richlabel takes about 1ms or less if you could provide me with details of why you think this happends, maybe ill have a look on it and open pr
Caching the RegEx didn't seem to do anything.
I tried setting set_bbcode()
and _set_bbcode()
to do nothing, and even then it was still slow to instantiate. So that implies it's something to do with the editor.
I then tried commenting out the _get_property_list()
and that actually seemed to be a big improvement. Which explains why built games don't have the problem.
Edit: Try having _get_property_list()
return nothing.
func _get_property_list():
return []
The phenomenon is basically the same as this problem: https://github.com/chairfull/GodotRichTextLabel2/issues/5
This is the running time in editor:
This is the running time in export exe:
The 145 fold time gap seriously affects the running of test projects in the editor.
The version I am using is: Godot v4.4.dev2 - Windows 10.0.22631 - OpenGL 3 (Compatibility) - NVIDIA GeForce RTX 2080 Ti (NVIDIA; 31.0.15.4633) - 12th Gen Intel(R) Core(TM) i5-12400F (12 Threads)