Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
substring match like "strstr"
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: eijiro_sumii@a...
Subject: Re: substring match like "strstr"
> I did not expect that OCamlB performs so well; so I suggested OcamlA and
> regexp (which are both fast for the bytecode interpreter, too). I think it
> depends also on the problem size (especially on the length of the substring).

Right, I forgot to mention those -- in the benchmark, the "needles"
(matched substrings) were 3 characters long and the "haystacks"
(searched strings) were about 20 characters long; I used the native
code compiler.  For much larger input, regexp could possibly do
better.  Anyway, thank you for the helpful suggestions.

// Eijiro Sumii (
// Ph.D. Student at Department of IS, University of Tokyo
// Visiting Scholar at Department of CIS, University of Pennsylvania