Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I'm going to go against the grain a bit here... I don't believe an RDBMS would be right for you. You don't seem to need flexibility. You just need speed. Moving to an RDBMS now is also likely to be costly in terms of code changes.

I do think that you should be indexing your "shell" data though. I did something similar years ago by using an in-memory BerkeleyDB (DB_HASH). (It just so happens that I was working for a financial management company too.) Although what I did was all in C, I think you could actually do this pretty easily using BerkeleyDB from Perl and get all the real benefits. Keep in mind that, even though a 700MB file really isn't a big deal when you've got 16GB of RAM, Perl's representation of that data is going to include a lot of overhead, so it's best if you can skip it.

Doing it that way should have a pretty minimal affect on your code, all things considered. In fact, you might find it simplifies things. You won't need any heuristics to determine how to search your "shell"... you'll just iterate through your holdings doing lookups. I think that boils down to O(N) vs. O(N*M) in your current situation.

That's the direction I'd be looking anyway.

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Speeding up data lookups by sauoq
in thread Speeding up data lookups by suaveant

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-19 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found