If you post some data and sample code you may be able to save yourself a rewrite. I believe the perlmonks record for recreational optimisation stands at several orders of magnitude. Good Perl can be extremely fast (in some cases only half the speed of C) and has some top notch optimisation tools.
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|