On Thursday, November 19, 2015 at 9:56:01 PM UTC-5, gustavo wrote: > > I did *some* hand optimizing. Here's the code for the soundex and some > > string helper functions I created: > > > > https://gist.github.com/lojic/1deba97f2e2eb2fe3fc0 > > > > I'm optimistic and I think that there is still some room for > micro-optimizations (for example, replace the set!'s, but I didn't try > yet).
I think the set!'s are what make it faster. Folks proposed various for statements which were much more elegant, but they were slower. I usually favor elegance over speed, and for the vast majority of my code, elegance/readability/etc. are more important, but this code takes hours to run, so speeding it up is helpful. > But more important is:Do you want to preserve the general structure of the > code? > > It has many small functions that are nice to write and debug, but each > one creates an intermediate string. In this algorithm, most of the > processing is character-by-character. So I think that most of the > calculations can be merged in a megafunction that avoids most of the > allocations. Possibly, but profiling showed that various string functions were on the critical path. > > Gustavo -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.