-
Notifications
You must be signed in to change notification settings - Fork 3
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
Refactor code for friendlier startup times #69
Comments
I agree that the CLI should start faster and not require GUI libraries to load. This has been in the back of my mind for a while, but I just never made it into an issue. |
The following naïve command took ~half an hour on my 2.3 GHz Core i7 Mac with an SSD: $ for img in (ivy -ea '<some-tag>'); ivy —set-rating 4 "$img"; end And if we take a look at how many items it's working on... $ ivy -ea '<some-tag>'|wc -l
363 ...it comes out to like 5 or 6 seconds per image. Clearly, this is way too long for a tag search, a few database upserts, and stuffing an XMP field into the files. It should be much faster to have used |
Using xargs to pass all the image paths in $ ivy -nea '<some-tag>' | xargs -0 time ivy --set-rating 4
23.29 real 16.76 user 2.27 sys This is about a 90X speedup. Clearly, avoiding multiple ivy invokations/init routines is a huge optimization. |
I started to play around with this and there's one thing I've noticed that immediately makes this a much larger issue: This is going to become a project, with this issue depending on the refactor of |
I was thinking it might be nice to move |
So currently, it looks like pretty much every GUI component in the app is allocated and statically initialized at startup whether it's ever used or not, because of how the code is written. This leads to poor startup times, and is especially wasteful when using ivy as a command line utility.
This can be ameliorated by instead of top-level
define
-ing everything for each module, export one or more functions that will create the required GUI objects on demand. Or a concrete subclasses that can easily be instantiated with all the desired default attributes.The text was updated successfully, but these errors were encountered: