Hi Daniel, Daniel de Rauglaudre wrote: > > Hi, > > On Fri, Jul 13, 2001 at 03:06:15PM -0700, Alexander V. Voinov wrote: > > > I've run the following program and found it to be extremely slow. Why? > > To be optimized, streams and parsers must be preprocessed by Camlp4. > If they are not, their code is longer, not tail recursive and can be > very very slow indeed. > > Compile you file with the option -pp camlp4o. Yes, the difference is substantial, but it gets longer and longer anyway with more elements parsed (for a slightly more complex program, which parses the stream as it is generated) and crashes at some point. I've attached the program (change parse_stream to parse_stream' and vice versa). Alexander