Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
About the only thing I can think of is to have a thread reading the images ahead of time and stuffing the pixbufs into a hash. Of course, with alot of images, that hash can get huge. Using it with iconview seems to be the hassle.

If the images are relatively constant, why not use a separate script that reads all the images, puts them into pixbufs, stashes them into a hash, then saves it as a Storable db. You can even store the thumbnail for the image too. Then when you run your program, it will just slurp in all the pixbufs from the Storable db.

If you want speed, I think displaying alot of images in a Liststore is not the right way to go. I faced the same problem in Gtk2-thumbnail-previewer. If I wsan't so lazy ( or was getting paid :-)) I would work out a way to preload with Storable, or if the images changed alot, use a thread to be making the pixbufs, and after it made the first subdir, continue on with others. But there is one catch, what if the user clicks on a subdir that hasn't been processed yet, you may need 2 threads...one for background work, and one for an unexpected click.

All in all, I think preloading them with Storable, will be the fastest. That way you only read the files once from disk, and combine them all into one big Storable db. The Storable db will load very fast, as it is only a single file.


I'm not really a human, but I play one on earth Remember How Lucky You Are

In reply to Re: how to speed up image file loading with gtk2 iconview? by zentara
in thread how to speed up image file loading with gtk2 iconview? by renegadex

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (9)
    As of 2014-12-29 13:29 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (188 votes), past polls