FreeCAD / FreeCAD-Bundle

Stand-alone repo to Build and Deploy installable FreeCAD images. Do not open general FreeCAD issues here.
https://freecad.org
GNU Lesser General Public License v2.1
322 stars 64 forks source link

Appimage UX: Very long loading times of some Themes in AppImage #302

Open MiqCG opened 3 months ago

MiqCG commented 3 months ago

Is there an existing issue for this?

Problem description

When in Light theme, shortcut for new file (Control + n) and others (Alt + f , Alt + e) don't work. If new file is created throw File menu with the mouse, then they work (see indications in the bottom part of the screencast). I think there is the same problem with revision 37841 and 37543. In some situations, clicking with the mouse on the menu bar doesn't work either. On the other hand, looks like loading/activating the Light theme is much much slower than Classic theme, as you can see in the attached video.

I have searched in Github for [is:issue light theme shortcut] and [is:issue light theme new file] with no relevant results

Full version info

OS: Devuan GNU/Linux 5 (daedalus) (XFCE/xfce)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37898 (Git) AppImage
Build type: Release
Branch: main
Hash: 308013fb975ec3bf0dc5cb616ef76a4095e71cc5
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: Catalan/Spain (ca_ES)
Installed mods: 
  * Movie 2024.2.15
  * sheetmetal 0.4.20
  * FreeCAD-motion-workbench-master
  * dodo 1.0.1
  * PieMenu 1.2.7
  * BillOfMaterials 0.0.8.5
  * fasteners 0.5.24

Subproject(s) affected?

Core

Anything else?

https://github.com/FreeCAD/FreeCAD-Bundle/assets/18265355/c728a522-ab91-4f0b-9fd5-fb72ff43206a

Code of Conduct

maxwxyz commented 3 months ago

@MisterMakerNL FYI

MiqCG commented 3 months ago

I thought it was not happening in revision 37543 but it is. I edited the first post. And is happening with "Dark behave" and "Dark theme" themes too.

MiqCG commented 3 months ago

Same behaviour in revision 37298. Maybe it's not that keyboard shortcuts are not working but the times/speed of loading of this themes that prevent FreeCAD to obey. The theme is apparently loaded after long time but maybe it is not totally loaded and cannot accept those orders. Don't know.

When you confirm me this hypothesis, I can change the title of the issue.

Loading_times_37928:

https://github.com/FreeCAD/FreeCAD/assets/18265355/95a159b2-3054-4268-9e1f-b90bf6e61725

Loading_times_37898:

https://github.com/FreeCAD/FreeCAD/assets/18265355/c6efd49e-e346-4e00-9b03-8ad82c600809

maxwxyz commented 3 months ago

@kadet1090 FYI

MisterMakerNL commented 3 months ago

I cannot reproduce this in windows with my own build.

Syres916 commented 3 months ago

For me this needs to be proven whether it's a distro specific issue, an actual FreeCAD code (which is now looking less likely) issue or a Conda packaging issue. As the OP's distro is originally based on Bookworm and I already have a Bookworm VM, I'll try that first.

If needed I'll then build and attempt to compile on a VM of Devuan GNU/Linux 5 (daedalus) (XFCE/xfce).

Syres916 commented 3 months ago

Could not reproduce the reported issue using Bookworm:

OS: Debian GNU/Linux 12 (bookworm) (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37931 (Git)
Build type: Release
Branch: main
Hash: f28394a376c285725abdacee3d72bd57a8b196aa
Python 3.11.2, Qt 5.15.8, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * sheetmetal 0.4.13
  * CfdOF 1.25.16
  * Assembly4 0.50.12
Syres916 commented 3 months ago

Can reproduce the reported issue using AppImage on Bookworm, going from Dark behave to Light theme is like watching paint dry and I can get it to raise FreeCAD 0.22dev is not responding Force Quit/Wait messagebox but the other way round is acceptable.

OS: Debian GNU/Linux 12 (bookworm) (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37928 (Git) AppImage
Build type: Release
Branch: main
Hash: e7699b531eba4bee262f7214699f07b96f66ba7b
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * sheetmetal 0.4.13
  * CfdOF 1.25.16
  * Assembly4 0.50.12

I have an older AppImage build 37302 which I'll have to extract and change the stylesheets over but that still won't prove if it's a Conda dependency that's changed, it really needs someone who can compile on Conda IMHO.

MisterMakerNL commented 3 months ago

Last lag issues where cause by switching Qstyle. But I also see issues with pixmap generation. And third the biggest difference between behave and others is probably the use of custom colors not sure if those cause extended load times.

Syres916 commented 3 months ago

@MiqCG could you please change the title of the issue to specifically mention applies to the AppImage specifically.

@MisterMakerNL with the AppImage extracted it's absolutely acceptable so it doesn't seem to be a code or stylesheet issue, it's only with the AppImage in it's original state that the time to change is six to seven times longer. Post release will probably need some more thought as to whether like the Templates for Techdraw they are copied out to the user's Shared folder on the first run or some other left field solution.

MiqCG commented 3 months ago

@Syres916 , what about "Very long loading times of some Themes in AppImage"?

Syres916 commented 3 months ago

Absolutely fine, thanks.

kinghat commented 3 months ago

ive been having terrible freezes with the appimage weeklies for at least a couple months now. here you can see it using only the classic theme selection from start after deleting the freecad .cache/.config/share dirs. so it has a fresh state. it also took like 15s to start(after the loading screen):

Screencast_20240702_144457.webm

OS: Fedora Linux 40 (KDE Plasma) (KDE/plasma) Word size of FreeCAD: 64-bit Version: 0.22.0dev.38001 (Git) AppImage Build type: Release Branch: main Hash: 1fc6da959b936a2999774a4fe5b4c4b12bf6ac8d Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2 Locale: English/United States (en_US)

Operating System: Fedora Linux 40 KDE Plasma Version: 6.1.1 KDE Frameworks Version: 6.3.0 Qt Version: 6.7.1 Kernel Version: 6.9.6-200.fc40.x86_64 (64-bit) Graphics Platform: Wayland Processors: 4 × Intel® Core™ i7-5600U CPU @ 2.60GHz Memory: 11.6 GiB of RAM Graphics Processor: Mesa Intel® HD Graphics 5500

JigglyBuff-Kun commented 3 months ago

I have the same issue mentioned as above. UI freezes for x seconds for every operation that is being done in FC. Sometimes It works, and I am able to do two operations. But sometimes just clicking on Create Parametric part in the start page freezes the UI for a good amount of time. FC starts with a warning (qt.qpa.plugin) Could not find the Qt platform plugin "wayland" in "" The issue goes way when I use X. This is Wayland specific I guess.

OS: Arch Linux (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.38079 (Git) AppImage
Build type: Release
Branch: main
Hash: de508e437d13e7eb35baffceea496fb9107888cb
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: English/United States (en_US)

Operating System: Arch Linux 
KDE Plasma Version: 6.1.2
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.9.8-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 24 × 12th Gen Intel® Core™ i9-12900K
Memory: 31.1 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 770
MisterMakerNL commented 2 months ago

should be fixed

kinghat commented 2 months ago

should be fixed

then the appimage freezes im having are unrelated as they continue as of:

OS: Fedora Linux 40 (KDE Plasma) (KDE/plasma) Word size of FreeCAD: 64-bit Version: 0.22.0dev.38261 (Git) AppImage Build type: Release Branch: main Hash: 51789ae8a1a0b1ed20317eaedcd190baac734e3d Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2 Locale: English/United States (en_US) Installed mods:

  • OpenTheme 2024.7.3
  • fasteners 0.5.24
  • lattice2 1.0.0
kadet1090 commented 2 months ago

@kinghat does it happen in any particular scenario?

kinghat commented 2 months ago

@kinghat does it happen in any particular scenario?

its basically every interaction with the ui as shown in this video: https://github.com/FreeCAD/FreeCAD-Bundle/issues/302

if i logout and back into my user session, before i run any other apps, i can sometimes get it to load and run without issues until i close it and open it again later on.

MisterMakerNL commented 2 months ago

I btw see you have opentheme, there was a bug in opentheme where the qtstyle script kept doing it thing causing lag. Have you updated Opentheme?

kinghat commented 2 months ago

I btw see you have opentheme, there was a bug in opentheme where the qtstyle script kept doing it thing causing lag. Have you updated Opentheme?

in freecad ive been running the most up 2 date of everything. most recent addons/themes/dev builds. also fedora which is basically the most up 2 date of everything kde as well. theres a post on the forum: https://forum.freecad.org/viewtopic.php?t=87325 where other kde people are having the exact same issue.

luzpaz commented 2 months ago

Is this specific to KDE ?

kinghat commented 2 months ago

Is this specific to KDE ?

i believe so.

MiqCG commented 2 months ago

Keeps happening with revision 38334 in an updated Linux Devuan 5 XFCE desktop. Classic loads the faster, in 2-4 seconds aprox Dark (from Classic) loads in 9-22 s aprox Light (from Dark) loads in 14-27 s aprox

luzpaz commented 2 months ago

@MiqCG can you please add the full About info to your post? TIA You are using XFCE and not KDE, correct ?

kinghat commented 2 months ago

as mentioned above, my and others issues might not be the same as this. ours is constant freezing on every action in the ui and not just at load.

MiqCG commented 2 months ago

OS: Devuan GNU/Linux 5 (daedalus) (XFCE/xfce) Word size of FreeCAD: 64-bit Version: 0.22.0dev.38334 (Git) AppImage Build type: Release Branch: main Hash: 61c964caa9a7e5bbc7a8d5f7d8914505d365113e Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2 Locale: Catalan/Spain (ca_ES)

JigglyBuff-Kun commented 2 months ago

This is fixed when you run as X on KDE. This is KDE issue on wayland.

kinghat commented 2 months ago

This is fixed when you run as X on KDE. This is KDE issue on wayland.

this is a freecad appimage(afaik as theres no dev flatpak builds) issue on kde wayland. none of my other apps have this problem.

JigglyBuff-Kun commented 2 months ago

Yeah, that's true. This is why need beta flatpak builds. I am running X to get FC working.

chennes commented 1 month ago

@maxwxyz should this get transferred to the Bundle repo? It sound from the above discussion like it's a purely appimage problem, with pretty specific parameters. I'd also suggest that on that basis it's not a release blocker.

luzpaz commented 3 weeks ago

This is a first impression UX issue and frankly kind of embarrassing if we release 1.0 with it still open. The wait time is misleading and people think FC has crashed since there is no visual indication that the operation is ongoing.

luzpaz commented 3 weeks ago

@probonopd any chance you could help troubleshoot the delay ?

MisterMakerNL commented 3 weeks ago

Can we check if it is the preference pack or the stylesheet. And if the stylesheet, can we check if it is the overlay stylesheet or the normal one or maybe both?

luzpaz commented 3 weeks ago

@MisterMakerNL It's a vanilla install for me so no preference packs enabled. These are the bundled themes/stylesheets that come installed.

I'll check if overlay is enabled. I don't think it is enabled by default on vanilla installs, right ?

Syres916 commented 3 weeks ago

@MisterMakerNL this testing was carried out using build 38827 AppImage, extracting and then repacking the AppImage after each change to the FreeCAD Dark.cfg to only load what I required at each stage. Here are my findings and to be honest as I expected:

<!DOCTYPE html>

Change Requested | Time To complete Change -- | -- Preference Pack Only | 4.02 seconds Pref Pack + Stylesheet Only | 16.36 seconds Pref Pack + Overlay Only | 6.45 seconds Pref Pack + Stylesheet & Overlay | 33.75 seconds
MisterMakerNL commented 3 weeks ago

Do you check if the latest stylesheet are installed, or are you doing a fresh install? I have had issues where it didn't overwrite the older stylesheets?

Syres916 commented 3 weeks ago

My testing was with no existing user.cfg/system.cfg/FreeCAD.conf config files and only using the stylesheets provided in the AppImage, no other stylesheets/addons were involved. It's quite clear that the more lines of text in any of the cfg or qss files makes the changeover longer, as simple as that IMHO. It's basically 5.5 times slower as a packed AppImage versus an extracted one.

MisterMakerNL commented 3 weeks ago

But we are talking about files less then 80Kb that should needn't need 30 second load time... Normally how I trouble should these issues is just delete half of the stylesheet, then test. if still long load times delete again half, and so keep going until I found the issue. This is how I last time found Qwidget be the cause of the loading issues.

probonopd commented 3 weeks ago

Does this happen only on KDE Plasma on Wayland? Then it might be related to https://github.com/AppImage/AppImageKit/issues/1351, the root cause of which is still unknown.

Can it be confirmed that the slowdown doesn't happen if one runs with --appimage-extract-and-run?

Syres916 commented 3 weeks ago

Does this happen only on KDE Plasma on Wayland?

Nope, I used OS: Debian GNU/Linux 12 (bookworm) (X-Cinnamon/cinnamon) for the above testing

Can it be confirmed that the slowdown doesn't happen if one runs with --appimage-extract-and-run?

I'll report back when my box is freed up from compiling.

Syres916 commented 2 weeks ago

@probonopd using --appimage-extract-and-run it takes 7.4 seconds instead of 33.75 seconds

probonopd commented 2 weeks ago

Is this on Wayland? If so, can you try on Xorg?

Syres916 commented 2 weeks ago

I thought the information above was clear that it's not on Wayland it's X-Cinnamon

probonopd commented 2 weeks ago

OK, then I don't have a hypothesis at the moment. Might be worth to experiment with different compression algorithms (we want to standardize on zstandard) and compression levels.

kinghat commented 2 weeks ago

Does this happen only on KDE Plasma on Wayland? Then it might be related to AppImage/AppImageKit#1351, the root cause of which is still unknown.

Can it be confirmed that the slowdown doesn't happen if one runs with --appimage-extract-and-run?

think this is fixed here: https://bugs.kde.org/show_bug.cgi?id=492584 my freecad freezing issues are not this one. also not sold on themes being the issue either.