Re: Find lines matching regexp in large text file - performance suggestions welcome

2008-10-23 Thread Mathias Dahl
> I don't see any way to significantly improve your speed, but I can > save you some lines of code: Thanks! I ended up calling out to grep instead :) Here is the code if someone else wants to do similar things: (defn real-grep [pattern] (debug (str "pattern: " pattern)) (let [cmd-arr

Re: Find lines matching regexp in large text file - performance suggestions welcome

2008-10-21 Thread Chouser
On Tue, Oct 21, 2008 at 11:24 AM, Mathias Dahl <[EMAIL PROTECTED]> wrote: > > Today I came up with this: > > (defn locate-lines [regexp] > (let [pattern (. java.util.regex.Pattern > (compile regexp >(. java.util.regex.Pattern > CASE_INSENSITIVE)))] >

Find lines matching regexp in large text file - performance suggestions welcome

2008-10-21 Thread Mathias Dahl
Today I came up with this: (defn locate-lines [regexp] (let [pattern (. java.util.regex.Pattern (compile regexp (. java.util.regex.Pattern CASE_INSENSITIVE)))] (debug (str "pattern: " pattern)) (with-open r (new java.io.LineNumberReader