First, run the script as it is with top in another window. We will need to know if gst-inspect-1.0 is actually burning half a second or so of CPU time or just spending most of its time blocked for some strange reason. If it is "blocky", running many instances in parallel will result in a huge performance improvement. If it is wasteful, running many instances in parallel will only help to the limit of your available hardware threads.

A better option may be to cache the gst plugins in a simple database. There is an SDBM module bundled with Perl that provides tied persistent hashes with a few limitations, most notably that each record (key and value) can be no larger than about 1KB. There are other DBM modules also available, but SDBM is self-contained and the others require relevant libraries be available when Perl is built.

If DBM is insufficient or unavailable, DBI provides SQL database bindings, with the DBD::SQLite backend bundling the required SQLite.

I have used both SDBM and SQLite in the past, with the deciding factor being the application. Since you do not mention what you seek to accomplish, I cannot really recommend one over the other for you.


In reply to Re: More Effecient Method Chaining by jcb
in thread More Effecient Method Chaining by fennewald

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.