Git Product home page Git Product logo

Comments (5)

lehitoskin avatar lehitoskin commented on May 30, 2024

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.

from ivy.

IonoclastBrigham avatar IonoclastBrigham commented on May 30, 2024

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 xargs, resulting in only 2 ivy invokations. But looping is still a usecase we should expect, especially if the particular sequence of actions doesn't naturally support spamming the command line with hundreds of arguments (e.g. renaming files in-place).

from ivy.

IonoclastBrigham avatar IonoclastBrigham commented on May 30, 2024

Using xargs to pass all the image paths in argv instead of doing one at a time in a loop, we get:

$ 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.

from ivy.

lehitoskin avatar lehitoskin commented on May 30, 2024

I started to play around with this and there's one thing I've noticed that immediately makes this a much larger issue: base.rkt needs to be pared down as small a footprint as possible. Only require the bare minimum libraries and nothing that is heavy, like racket/gui/base. This will require breaking out the image loading into its own file (which was on the docket already, but never formally tracked on GitHub.)

This is going to become a project, with this issue depending on the refactor of load-image before we can proceed.

from ivy.

IonoclastBrigham avatar IonoclastBrigham commented on May 30, 2024

I was thinking it might be nice to move load-image into ivy-canvas%.

from ivy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.