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

Moderate Performance Issues Loading Scripts With v4.0 Beta 16 IDE On Linux #72448

Open
ghost opened this issue Jan 31, 2023 · 15 comments
Open

Moderate Performance Issues Loading Scripts With v4.0 Beta 16 IDE On Linux #72448

ghost opened this issue Jan 31, 2023 · 15 comments

Comments

@ghost
Copy link

ghost commented Jan 31, 2023

Godot version

v4.0.beta16.official [518b9e5]

System information

Linux Mint 21.1 Cinnamon 64Bit

Issue description

Hi,

Have moderate performance issues with v4.0 Beta 16 IDE on Linux.

Running Godot Engine v4.0 Beta 16 official Linux on below system:

  • Hyper-Custom ''JeZxLee'' Pro-Built Desktop
  • Desktop Code Name: ''Optimus Prime''
  • Genuine ''Linux Mint 21.1 Cinnamon 64Bit'' Linux
  • Corsair 750watt Modular Power Supply
  • GIGABYTE GA-970A-DS3P 2.0 AM3+ Motherboard
  • AMD FX 3.5GHz(4GHz Turbo) 8-Core CPU
  • Corsair 32GB DDR3 RAM Memory
  • nVidia GeForce GTX 970TT 4GB GDDR5 GPU
  • ADATA 1TB SSD Hard Drive(OS/Apps)
  • Western Digital 1TB HDD Hard Drive(Personal Data)

See steps to reproduce...

Thanks!

Jesse

Steps to reproduce

  • Load a Godot 4 project into Linux Beta 16 IDE
  • Click on different scripts in the scripts pane
    (loading each individual script takes over 1 second?)

Minimal reproduction project

Not applicable

@Zireael07
Copy link
Contributor

Please edit the issue title to mention that it's to do with scripts loading, otherwise it's liable to get closed by mistake as a duplicate of several other general 'Godot 4 feels slow' issues

@ghost ghost changed the title Moderate Performance Issues With v4.0 Beta 16 IDE On Linux Moderate Performance Issues Loading Scripts With v4.0 Beta 16 IDE On Linux Jan 31, 2023
@ghost
Copy link
Author

ghost commented Jan 31, 2023

Ok, done...

@Sslaxx
Copy link

Sslaxx commented Jan 31, 2023

How does this compare to previous betas. Have you had this issue before?

@Calinou
Copy link
Member

Calinou commented Jan 31, 2023

This is likely a duplicate of #71795, #71084 and/or #70869.

How long are each of your scripts? Do they have very long lines? Any specific editor settings you're using?

@ghost
Copy link
Author

ghost commented Jan 31, 2023

Please look over the project below:
https://github.com/BetaMaxHero/GDScript_Godot_4_T-Story
(above is an older release, but 99% similar to what we are using)

@Zireael07
Copy link
Contributor

@Calinou I don't think it's a dupe of #71795, OP says it's to do with loading the scripts

@BetaMaxHero are there many scripts open (in the IDE list) at the same time?

@ghost
Copy link
Author

ghost commented Jan 31, 2023

I have all 8 scripts loaded in the scripts pane.
There is a 1-2 second delay switching scripts in the scripts pane.
It's not my high-spec Linux computer.
Linux IDE requires further optimization.

@ghost
Copy link
Author

ghost commented Feb 1, 2023

Checked v4.0 Beta 16 on a Windows 11 Pro 64Bit mid-range SFF desktop.
No performance issues on Windows.

This is only affecting Linux.

@Calinou
Copy link
Member

Calinou commented Feb 1, 2023

Linux IDE requires further optimization.

The rendering code is the exact same – Godot does not use OS-specific libraries for its UI. The most likely cause for the editor performing worse on Linux is that compositing on X11 is notoriously slow compared to Windows.

I recommend using a window manager that doesn't force compositing (such as KWin or Xfwm) and disable compositing while comparing performance with Windows. If this is not an option, enable fullscreen in the editor by pressing Shift + F11 (on both Windows and Linux).

If you can compile from source, try using a C++ profiler on a debug build to see what's taking the most time.

@ghost
Copy link
Author

ghost commented Feb 1, 2023

Hi,

Sorry, but I am running Godot Engine v4.0 Beta 16 on Windows 11 Pro 64Bit now...
I have a hard deadline for releasing "Release Candidate 1".

Let me get this game out the door in about two weeks(or less), and I will revisit the performance issues on my Linux.

Thanks!

Jesse

@ghost
Copy link
Author

ghost commented Feb 1, 2023

"The most likely cause for the editor performing worse on Linux is that compositing on X11 is notoriously slow compared to Windows."

  • I don't agree - this desktop runs Doom(2016) at 1080P on "High" settings...

@Calinou
Copy link
Member

Calinou commented Feb 1, 2023

  • I don't agree - this desktop runs Doom(2016) at 1080P on "High" settings...

Fullscreen games suspend compositing, while the Godot editor is a windowed application (at least by default).

@ghost
Copy link
Author

ghost commented Feb 2, 2023

Ok, I'll revisit this in a couple of days - thank you!

@Paulb23
Copy link
Member

Paulb23 commented Feb 5, 2023

Cloned: https://github.com/BetaMaxHero/GDScript_Godot_4_T-Story

Spent some time switching between tabs using HotSpot, can confirm it take a second or so, seems like most of the time is spent parsing GDScript (bottom-up view from HotSpot):

image

Here's the full callstack with the "top" time consumers when switching:

method cycles:u
ScriptEditor::_script_selected(int) 32.8%
ScriptEditor::_go_to_tab(int) 32.8%
ScriptEditor::_update_members_overview() 27.8%
ScriptTextEditor::get_functions() 31.8%
GDScriptLanguage::validate(String const&, String const&, List<String, DefaultAllocator>, List<ScriptLanguage::ScriptError, DefaultAllocator>, List<ScriptLanguage::Warning, DefaultAllocator>, HashSet<int, HashMapHasherDefault, HashMapComparatorDefault >) const 31.8%
GDScriptParser::parse(String const&, String const&, bool) 32%
GDScriptParser::parse_program() 66.8%
GDScriptParser::parse_class_body(bool) 66.8%
void GDScriptParser::parse_class_memberGDScriptParser::FunctionNode(GDScriptParser::FunctionNode*(GDScriptParser::*)(), GDScriptParser::AnnotationInfo::TargetKind, String const&) 67%
GDScriptParser::parse_function() 66.6%
GDScriptParser::parse_suite(String const&, GDScriptParser::SuiteNode*, bool) 66.1%
GDScriptParser::parse_statement() 66.4%
GDScriptParser::parse_if(String const&) 52.9%
GDScriptParser::parse_expression(bool, bool) 37.8%
GDScriptParser::parse_precedence(GDScriptParser::Precedence, bool, bool) 52.1%
GDScriptParser::advance() 36%
GDScriptTokenizer::scan() 55.7%
GDScriptTokenizer::potential_identifier() 50.0%
TextServerAdvanced::is_confusable(String const&, Vector const&) const 48.2%
uspoof_getSkeleton_72_godot 40.8%
uspoof_getSkeletonUnicodeString_72_godot(USpoofChecker const*, unsigned int, icu_72_godot::UnicodeString const&, icu_72_godot::UnicodeString&, UErrorCode*) 37.4%
icu_72_godot::SpoofData::confusableLookup(int, icu_72_godot::UnicodeString&) const 25.4%

@Calinou
Copy link
Member

Calinou commented Feb 5, 2023

It seems ICU's is_confusable() implementation is taking a lot of time. cc @bruvzg

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