Re: [Caml-list] Efficient scanning of large strings from files

2012-03-19 Thread Philippe Veber
Thanks Edgar and Jérémie, this indeed seems to be the right track. I just hope that a repeated use of input_char is not 10-100X slower than input_line :o). ph. 2012/3/16 Edgar Friendly thelema...@gmail.com So given a large file and a line number, you want to: 1) extract that line from the file

Re: Re: [Caml-list] Efficient scanning of large strings from files

2012-03-19 Thread Philippe Veber
Yes indeed! 2012/3/16 FrancoisCharles MatthieuBerenger beren...@riken.jp hi philippe, i am curious, is your string a dna sequenceso that s why it is so long? regards,f On Fri, 16 Mar 2012 10:14:41 -0400 Edgar Friendly thelema...@gmail.com wrote: On 03/16/2012 09:03 AM,

Re: [Caml-list] Efficient scanning of large strings from files

2012-03-19 Thread Edgar Friendly
On 03/19/2012 05:08 AM, Philippe Veber wrote: Thanks Edgar and Jérémie, this indeed seems to be the right track. I just hope that a repeated use of input_char is not 10-100X slower than input_line :o). ph. Quite true - instead of giving the matcher just a single byte at a time, it is more

Re: [Caml-list] Efficient scanning of large strings from files

2012-03-18 Thread Török Edwin
On 03/16/2012 04:49 PM, Jérémie Dimino wrote: Le Fri, 16 Mar 2012 14:03:38 +0100, Philippe Veber philippe.ve...@gmail.com a écrit : Say that you'd like to search a regexp on a file with lines so long that you'd rather not load them entirely at once. If you can bound the size of a match by k

Re: [Caml-list] Efficient scanning of large strings from files

2012-03-18 Thread oliver
On Fri, Mar 16, 2012 at 02:03:38PM +0100, Philippe Veber wrote: Dear camlers, Say that you'd like to search a regexp on a file with lines so long that you'd rather not load them entirely at once. If you can bound the size of a match by k length of a line, then you know that you can only

Re: Re: [Caml-list] Efficient scanning of large strings from files

2012-03-17 Thread oliver
DNA: C, G, A, T, \n On Sat, Mar 17, 2012 at 02:23:48AM +0900, FrancoisCharles MatthieuBerenger wrote: hi philippe, i am curious, is your string a dna sequenceso that s why it is so long? regards,f On Fri, 16 Mar 2012 10:14:41 -0400 Edgar Friendly thelema...@gmail.com

[Caml-list] Efficient scanning of large strings from files

2012-03-16 Thread Philippe Veber
Dear camlers, Say that you'd like to search a regexp on a file with lines so long that you'd rather not load them entirely at once. If you can bound the size of a match by k length of a line, then you know that you can only keep a small portion of the line in memory to search the regexp.

Re: [Caml-list] Efficient scanning of large strings from files

2012-03-16 Thread Edgar Friendly
On 03/16/2012 09:03 AM, Philippe Veber wrote: Dear camlers, Say that you'd like to search a regexp on a file with lines so long that you'd rather not load them entirely at once. If you can bound the size of a match by k length of a line, then you know that you can only keep a small portion of

Re: [Caml-list] Efficient scanning of large strings from files

2012-03-16 Thread Jérémie Dimino
Le Fri, 16 Mar 2012 14:03:38 +0100, Philippe Veber philippe.ve...@gmail.com a écrit : Say that you'd like to search a regexp on a file with lines so long that you'd rather not load them entirely at once. If you can bound the size of a match by k length of a line, then you know that you can

Re: [Caml-list] Efficient scanning of large strings from files

2012-03-16 Thread Philippe Veber
2012/3/16 Edgar Friendly thelema...@gmail.com On 03/16/2012 09:03 AM, Philippe Veber wrote: Dear camlers, Say that you'd like to search a regexp on a file with lines so long that you'd rather not load them entirely at once. If you can bound the size of a match by k length of a line, then

Re: [Caml-list] Efficient scanning of large strings from files

2012-03-16 Thread oliver
On Fri, Mar 16, 2012 at 02:03:38PM +0100, Philippe Veber wrote: Dear camlers, Say that you'd like to search a regexp on a file with lines so long that you'd rather not load them entirely at once. If you can bound the size of a match by k length of a line, then you know that you can only