Recent

Author Topic: AArch64. Slow program start  (Read 993 times)

LemonParty

  • Sr. Member
  • ****
  • Posts: 391
AArch64. Slow program start
« on: November 10, 2025, 04:46:31 pm »
I have a Raspberry 5 with Debian on it. And my simple program that uses SQLite loads 5+ seconds. The same program on Windows starts allmost immediately. Also Lazarus on this system also loads 5+ seconds. Is there a reason why it is so slow?
« Last Edit: November 10, 2025, 04:53:56 pm by LemonParty »
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

Thaddy

  • Hero Member
  • *****
  • Posts: 18517
  • Here stood a man who saw the Elbe and jumped it.
Re: AArch64. Slow program start
« Reply #1 on: November 11, 2025, 11:09:11 am »
How do you run Debian on the Raspberry Pi 5? If you run from an SD card, what type? It looks like storage speed issue.
You can run the OS from a SSD, did you know that?
But, don't expect to run as fast as a Windows PC running on a, e.g. Ryzen 7 16 core with a superfast M2-SSD.(My laptop)
That is not what a RPi 5 is for.
« Last Edit: November 11, 2025, 11:11:33 am by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

dbannon

  • Hero Member
  • *****
  • Posts: 3612
    • tomboy-ng, a rewrite of the classic Tomboy
Re: AArch64. Slow program start
« Reply #2 on: November 11, 2025, 12:02:23 pm »
Yes , as Thaddy says, the SDCardis simply not suitable.

Even a newish USB diskkey (ie thumbdrive) will do a better job, boot (if you like) on the SDCard but mount and install and external and install the big apps AND the swap file there.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

LemonParty

  • Sr. Member
  • ****
  • Posts: 391
Re: AArch64. Slow program start
« Reply #3 on: November 11, 2025, 12:10:34 pm »
Probably this is a SD card speed issue.
I tested the speed of SD card and it is 20 mb/s.
But when I run a default file manager it stats immediately.
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

Thaddy

  • Hero Member
  • *****
  • Posts: 18517
  • Here stood a man who saw the Elbe and jumped it.
Re: AArch64. Slow program start
« Reply #4 on: November 11, 2025, 04:00:35 pm »
A file manager is way lighter than the behemoth full Lazarus install.
What you can do is limit the number of components to the ones you really need.
But that is not necessary when you run from a more expensive SDSX card or a good USB3 stick or best an SSD.
Some more expensive cards and most newer USB3 sticks have throughput for read of well over 100Mb/sec. That is also the minimum recommended read speed. (Write speed is less essential)
SSD can reach a manyfold of that, way above 500Mb/sec. A good 64 GB USB3 stick costs under 7 euro here, with 128GB at 12 euro.
A fast SD card is around 20 euro for 128GB. An external 512GB - 1TB SSD comes in at around 50 euro or less and is recommended.
The Raspberri Pi 5 supports booting from SSD directly. (4 too, 3 and earlier need SD bootstrap)
Look for an SSD with its own external powersupply! if you plan to do extensive work on your Pi5. (overheating can be a problem)
I bought a separate housing and an internal m2-SSD to fit in it.
« Last Edit: November 11, 2025, 04:34:05 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

paweld

  • Hero Member
  • *****
  • Posts: 1521
Re: AArch64. Slow program start
« Reply #5 on: November 12, 2025, 07:23:24 am »
In my opinion, the cause may be Wayland—try switching to X11. When I was playing around with RPi recently, it was the reason for the long startup time of Lazarus and the programs compiled in it.
Best regards / Pozdrawiam
paweld

Thaddy

  • Hero Member
  • *****
  • Posts: 18517
  • Here stood a man who saw the Elbe and jumped it.
Re: AArch64. Slow program start
« Reply #6 on: November 12, 2025, 10:47:05 am »
Can you elaborate on that? Because Wayland has many issues, but not startup time.
(And I have lot's of Pi's)
SD cards have many issues...

TIP: On RPi's, use Qt (3,5,+), not GTK2,  as widgetset. That removes a lot of the Wayland problems for Lazarus, because Qt is way ahead on Wayland.
But does not affect load times.
« Last Edit: November 12, 2025, 10:54:30 am by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

dbannon

  • Hero Member
  • *****
  • Posts: 3612
    • tomboy-ng, a rewrite of the classic Tomboy
Re: AArch64. Slow program start
« Reply #7 on: November 12, 2025, 11:20:35 am »
I think we are searching too deeply here.

Loading Lazarus from a SDCard is expected to be slow. Its a RasPI5 but how much memory ?  RasPi OS has a very poor swap install by default, too small and controlled by some gee wizz (but unfamiliar to me) dphys-swapfile. If you go into swap, and the swap file is on the SDCard, 5 seconds is pretty good IMHO.

Move swapfile, big applications, multifile libraries and databases onto a better disk.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

ALLIGATOR

  • Sr. Member
  • ****
  • Posts: 305
  • I use FPC [main] 💪🐯💪
Re: AArch64. Slow program start
« Reply #8 on: November 12, 2025, 11:26:11 am »
Maybe you just need to use a profiler?

perf + https://github.com/KDAB/hotspot
I may seem rude - please don't take it personally

paweld

  • Hero Member
  • *****
  • Posts: 1521
Re: AArch64. Slow program start
« Reply #9 on: November 12, 2025, 11:31:12 am »
Quote
Can you elaborate on that? Because Wayland has many issues, but not startup time.
i.e. https://forum.lazarus.freepascal.org/index.php/topic,65377.0.html
Best regards / Pozdrawiam
paweld

Thaddy

  • Hero Member
  • *****
  • Posts: 18517
  • Here stood a man who saw the Elbe and jumped it.
Re: AArch64. Slow program start
« Reply #10 on: November 12, 2025, 11:48:43 am »
Quote
Can you elaborate on that? Because Wayland has many issues, but not startup time.
i.e. https://forum.lazarus.freepascal.org/index.php/topic,65377.0.html
I don't get it.
I have almost all RPi's running (except 2), yes, also a RPi1. ALL of them run a FPC compiler. Most of them also run Lazarus, with a swap partition and that even includes the RPi one.(ELEVEN YEARS OLD)
I really don't get it.
Yes, AARCH64 caused some problems but all of these are solved a long time ago.
Wayland caused more problems.
It is not the compiler, but Lazarus compiled for GTK2 is the problem on AARCH64, IOW GTK2 as default.
Simply use Qt5 for AARCH64 and Lazarus.
« Last Edit: November 12, 2025, 11:57:40 am by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

paweld

  • Hero Member
  • *****
  • Posts: 1521
Re: AArch64. Slow program start
« Reply #11 on: November 12, 2025, 11:57:27 am »
I only have statements from rpi 3, 4, and 5, and since Wayland was enabled by default, it always caused problems. After switching to X11, everything is fine.
I used gtk2 on each of them.
Best regards / Pozdrawiam
paweld

Thaddy

  • Hero Member
  • *****
  • Posts: 18517
  • Here stood a man who saw the Elbe and jumped it.
Re: AArch64. Slow program start
« Reply #12 on: November 12, 2025, 11:58:54 am »
Yes, that is the known solution, but is it the right one? GTK2 is abandonware.
Lazarus has sane alternatives, but sticks to... well, GTK2....as default (which isn't a default in general current Linux distributions)
That is beyond me.

(Flame is already off here..)

Has nothing to do with Raspberry Pi.
« Last Edit: November 12, 2025, 12:03:01 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

paweld

  • Hero Member
  • *****
  • Posts: 1521
Re: AArch64. Slow program start
« Reply #13 on: November 12, 2025, 12:28:20 pm »
Quote from: Thaddy
Yes, that is the known solution, but is it the right one? GTK2 is abandonware.
Perhaps, but it works OOTB on every Linux distribution (that I have encountered), and does not require additional dependencies as in the case of QT.
Quote
Has nothing to do with Raspberry Pi.
If disabling Wayland in favor of X11 solves the problem, then it is related with RPi.
Best regards / Pozdrawiam
paweld

Thaddy

  • Hero Member
  • *****
  • Posts: 18517
  • Here stood a man who saw the Elbe and jumped it.
Re: AArch64. Slow program start
« Reply #14 on: November 12, 2025, 12:34:02 pm »
No, I have the same with recent Debians which default to Wayland ---> Means that ALL other Debian derivatives, including Ubuntu have the same issues.
You need to INSTALL X11, or xwayland  to  some extend.
Sleep well.
(This is a subject that can be solved for Lazarus if it would use Qt as default)
« Last Edit: November 12, 2025, 12:37:29 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

 

TinyPortal © 2005-2018