XP is just a number | |
PerlMonks |
Re: KinoSearch & Large Documentsby creamygoodness (Curate) |
on Feb 11, 2007 at 04:57 UTC ( [id://599428]=note: print w/replies, xml ) | Need Help?? |
3MB shouldn't be any trouble at all. Indexing time increases roughly linearly with the length of the text. (Once KinoSearch's internal caches start getting flushed the numbers get noisy, but that happens every 10-15MB of content and it's unlikely to be the problem.) Here's a benchmarking result demonstrating the relationship:
One possibility is that that somebody, somewhere has used one of the hateful match variables: $' $` and $&. Their appearance anywhere in your script or its dependencies will completely destroy the performance of KinoSearch's Tokenizer, which runs a short regex over a large string many times in a tight loop. It's shocking how awful things get, and indeed, the degradation is geometric. Check out Devel::SawAmpersand for an explanation and the sawampersand function which you can use to investigate. Old versions of Text::Balanced are known to cause this problem. (Maybe I should have Tokenizer's constructor issue a warning if Devel::SawAmpersand::sawampersand() returns true.) Another possibility is that you're hitting swap. It sounds like you've got adequate RAM on that box, and KS itself doesn't need a whole lot -- 30MB or so, not factoring in space occupied by the current doc. But it's worth my asking about for the sake of completeness, since the symptoms are consistent with that diagnosis, too. If neither of those help, try running the script I used to generate the benchmarking output above. If it produces results in line with mine, that suggests that the problem lies elsewhere in your app.
In Section
Seekers of Perl Wisdom
|
|