Hi, in my app for Sailfish OS I've got a really long startup time compared to other apps. (On the first load it is especially long, I assume because Quicklisp is loading systems.)
The longest wait and the one that would make startup time good enough for me if it was gone is marked with "-->":
$ eql5 --version [D] unknown:0 - Using Wayland-EGL EQL5 20.7.1 (ECL 20.4.24, Qt 5.6.3)
$ pusfofefe [D] unknown:0 - Using Wayland-EGL ;;; Loading #P"/usr/lib/ecl-20.4.24/ecl-quicklisp.fas" ;;; Loading #P"/usr/lib/ecl-20.4.24/ecl-curl.fas" ;;; Loading #P"/usr/lib/ecl-20.4.24/sockets.fas" ;;; Loading "/home/nemo/quicklisp/setup.lisp" ;;; Loading #P"/usr/lib/ecl-20.4.24/asdf.fas" --> Reading config "/home/nemo/.config/pusfofefe/config.lisp"... Config read. Reading messages from "/home/nemo/.config/pusfofefe/messages.lisp"... 50 messages read.
It seems to be right before my code starts running. Is this an issue for EQL5-Android/iOS as well? Any fixes?
Regards, Erik
On 12/28/20, Erik Winkels aerique@xs4all.nl wrote:
;;; Loading #P"/usr/lib/ecl-20.4.24/asdf.fas"
--> Reading config "/home/nemo/.config/pusfofefe/config.lisp"... Config
Loading ASDF on mobile _is_ slow, and there is nothing we can do about it, unfortunately.
ASDF should therefore never be a dependency in a final app (there are ways to avoid it, even if some libraries want it to be present.)
With Sailfish there is the problem that prebuilt ECL and EQL5 are still 32bit, so on my (quite recent) Sailfish 64bit phone, loading ASDF takes about 2(!) seconds. That would be less if 64bit compiled, I know from android, where loading ASDF on 64bit takes "only" about 1 second.
Paul
Hi,
On Friday, January 1, 2021, PR wrote:
Loading ASDF on mobile _is_ slow, and there is nothing we can do about it, unfortunately.
ASDF should therefore never be a dependency in a final app (there are ways to avoid it, even if some libraries want it to be present.)
Thanks, I'll move that to my longer term to-do list then.
With Sailfish there is the problem that prebuilt ECL and EQL5 are still 32bit,
Ah yes, welcome to Sailfish!
Erik
On 1/1/21, Erik Winkels aerique@xs4all.nl wrote:
Ah yes, welcome to Sailfish!
Thanks, yeah it's a great OS, it's hard not to love it, once you've played around with it!
I will try to add some example myself, so in future this (almost empty) repo will hopefully get populated:
https://gitlab.com/eql/eql5-sailfish
Paul
On 2021-01-01 13:56, PR wrote:
I will try to add some example myself, so in future this (almost empty) repo will hopefully get populated:
I was a little busy this week so only noticed this mail now. That looks good, glad someone more experienced with Qt and EQL is on board!
Hi,
On 2021-01-01 12:12, PR wrote:
Loading ASDF on mobile _is_ slow, and there is nothing we can do about it, unfortunately.
I've alleviated my slow startup somewhat by
diff --git a/make.lisp b/make.lisp index 41d4e3d..52b05b6 100644 --- a/make.lisp +++ b/make.lisp @@ -13,7 +13,8 @@ (asdf:make-build "app" :monolithic t :type :static-library - :prologue-code '(require :ecl-quicklisp) + :prologue-code '(progn (require :sb-bsd-sockets) + (require :asdf)) :move-here "./" :init-name "init_lib_APP__ALL_SYSTEMS")
At least now I only have the slow startup time of ASDF which is currently acceptable for my app. At least it doesn't install Quicklisp on the first run anymore ;-)
ASDF should therefore never be a dependency in a final app (there are ways to avoid it, even if some libraries want it to be present.)
I found this post (of yours?): https://www.reddit.com/r/Common_Lisp/comments/hicmyt/error_with_uiop_running...
Is this what you meant? Where do you use this code?
Bye, Erik
On Tuesday, January 12, 2021 1:30 PM, Erik Winkels aerique@xs4all.nl wrote:
I found this post (of yours?): https://www.reddit.com/r/Common_Lisp/comments/hicmyt/error_with_uiop_running...
Is this what you meant? Where do you use this code?
Yes, that was me. As (hopefully) everybody knows, ASDF is only intended to be used for loading/building CL libs or apps, and if some library depends on it at runtime, that's simply wrong by design; ASDF was never meant to be used like that.
In my case, some library pretended ASDF to be present, without ever really using it, but it gave runtime package errors. So I just added the above, and it worked without problems (in my specific case).
So, my question is: if you don't add ASDF as a dependency, what error messages do you get at app startup?
Another way to deal with a _real_ ASDF runtime dependency (e.g. you want Swank to be running for eventual problems) and also keeping the startup time short, would be to start up the app first, and loading ASDF (together with any lib depending on it) in a thread, while keeping the UI responsive. I've done this successfully on mobile.
Paul
P.S. I will probably try to build your app and see for myself (having the possibility now)
Hi,
A bit of a late reply since the discussion has already continued but:
On 2021-01-12 18:50, pls.153 wrote:
So, my question is: if you don't add ASDF as a dependency, what error messages do you get at app startup?
When I do not `(require :sb-bsd-sockets)` I get:
Condition of type: SIMPLE-ERROR Package ((SB-BSD-SOCKETS . #<SB-BSD-SOCKETS package>)) referenced in compiled file NIL but has not been created
and when I leave out `(require :asdf)` I get:
Condition of type: SIMPLE-ERROR The packages ((UIOP/OS . #<UIOP/OS package>) (UIOP/PATHNAME . #<UIOP/PATHNAME package>)) were referenced in compiled file NIL but have not been created
I tried your trick of doing a `defpackage` instead and while it worked it did not have a noticeable impact on startup time.
Anyway, for now the startup time is good enough.
Thanks, Erik
On Thursday, January 14, 2021 2:09 PM, Erik Winkels
Anyway, for now the startup time is good enough.
FWIW, loading :asdf alone is faster than I previously thought. With the compiler already loaded (require :cmp), I get (on Sailfish with 32bit ECL):
(time (require :asdf))
;;; Loading #P"/usr/lib/ecl-20.4.24/asdf.fas" real time : 0.968 secs run time : 0.950 secs gc count : 10 times consed : 18966096 bytes ("ASDF" "asdf" "UIOP" "uiop")
Which seems good enough.
Paul
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Tuesday, January 12, 2021 1:30 PM, Erik Winkels aerique@xs4all.nl wrote:
I've alleviated my slow startup somewhat by
diff --git a/make.lisp b/make.lisp index 41d4e3d..52b05b6 100644 --- a/make.lisp +++ b/make.lisp @@ -13,7 +13,8 @@ (asdf:make-build "app" :monolithic t :type :static-library
- :prologue-code '(require :ecl-quicklisp)
- :prologue-code '(progn (require :sb-bsd-sockets)
- (require :asdf))
:move-here "./" :init-name "init_lib_APP__ALL_SYSTEMS")
ok, so I just tried to build a dummy app on the desktop (problem is the same there) with the dependencies listed in your ASDF definitions. I added :uiop as an additional dependency (both in *.asd and 'dependencies.lisp'), but this still didn't work without adding :asdf.
But after the following hack (in 'make.lisp') I was able to run the app without startup errors:
:prologue-code '(progn (require :sb-bsd-sockets) (defpackage uiop/os) (defpackage uiop/pathname) (defpackage uiop/filesystem) (defpackage asdf/operate) (defpackage asdf/lisp-action) ;;(require :asdf) )
As you can see, creating some dummy packages and excluding ASDF worked (of course you need to test if your app still works this way).
Paul
Make sure you have uiop (a library) in your local projects or another registry - otherwise asdf won't add it to the bundle because it is 'preloaded' - and ql won't download it - ditto.
Daniel
Wysłano z aplikacji ProtonMail
-------- Oryginalna wiadomość -------- 13 sty 2021, 08:39, pls.153 napisał(a):
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Tuesday, January 12, 2021 1:30 PM, Erik Winkels aerique@xs4all.nl wrote:
I've alleviated my slow startup somewhat by
diff --git a/make.lisp b/make.lisp index 41d4e3d..52b05b6 100644 --- a/make.lisp +++ b/make.lisp @@ -13,7 +13,8 @@ (asdf:make-build "app" :monolithic t :type :static-library
- :prologue-code '(require :ecl-quicklisp)
- :prologue-code '(progn (require :sb-bsd-sockets)
- (require :asdf))
:move-here "./" :init-name "init_lib_APP__ALL_SYSTEMS")
ok, so I just tried to build a dummy app on the desktop (problem is the same there) with the dependencies listed in your ASDF definitions. I added :uiop as an additional dependency (both in *.asd and 'dependencies.lisp'), but this still didn't work without adding :asdf.
But after the following hack (in 'make.lisp') I was able to run the app without startup errors:
:prologue-code '(progn (require :sb-bsd-sockets) (defpackage uiop/os) (defpackage uiop/pathname) (defpackage uiop/filesystem) (defpackage asdf/operate) (defpackage asdf/lisp-action) ;;(require :asdf) )
As you can see, creating some dummy packages and excluding ASDF worked (of course you need to test if your app still works this way).
Paul
On Wednesday, January 13, 2021 11:39 AM, Daniel Kochmański daniel@turtleware.eu wrote:
Make sure you have uiop (a library) in your local projects or another registry - otherwise asdf won't add it to the bundle because it is 'preloaded' - and ql won't download it - ditto.
thanks, I never needed uiop, but that works: I copied uiop from the asdf source tree to ~/quicklisp/local-projects/, and now it gets included.
Paul