Jul 20, 2001, 1:24 AM
Post #3 of 4
Re: exists() / grep too slow ?
[In reply to]
when you say 'too much time', what periods of time are you talking about?
I've tested a piece of code similar to yours that also implements a message lifo. With 50 different messages, each at a length of 500 characters and up to 10 messages in the lifo, I could do 14000 checks per second on my system (P2/266).
Considering the overhead of the Net::IRC module (which I don't have installed), I'd guess that grep isn't the bottleneck of your application.
FYI, I've also checked some other ways of implementing this using hash tables. These were insignificantly faster on short messages (about 10%), but reasonably slower on longer messages.
Hope this helps.