|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re: Re: Performance quandaryby SwellJoe (Scribe) |
| on Feb 26, 2002 at 13:33 UTC ( #147553=note: print w/ replies, xml ) | Need Help?? |
|
Thanks for your comments dws, I suspect you're probably right about an in-memory hash to speed lookups of existing keys. I will try this, in addition to the database structure changes suggested by tilly. I'm still spending some think time on how exactly to structure the db to minimize lookups while still keeping each object tiny and very simple to parse--everything I come up with seems to lead to more seeks/fetchs than I already have, but the objects do get smaller. An in-memory hash of existing keys would probably remove a lot of extraneous seeks. As for the MD5, you haven't read all of my posts! The MD5 we generate is a key requirement of the program, not an option, or just another way to generate a unique key. We have to match the Squid key for a given object--there is no way around that one. Besides, generating the MD5 is a miniscule part of CPU time being used. Since I haven't posted any profiles lately, I'll do so here (as good a place as any):
This is a full build of a quarter million object cache (the real world will have 1-3 million objects but a much faster and more memoried machine). MD5 generation is 25 seconds out of 36923.77 seconds...I'm not worried about MD5 time. ;-)
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||