[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: speed up u8_strstr

From: Bruno Haible
Subject: Re: speed up u8_strstr
Date: Sat, 31 Jul 2010 21:48:56 +0200
User-agent: KMail/1.9.9

Hi Pádraig,

> > the u8_strstr function.
> I wonder could we speed that up for UTF-8
> by just deferring to strstr() ?

This is a good idea, because the naïve implementation of u8_strstr is
quadratic (O(n²)), whereas for strstr we now have an O(n) algorithm.

But at the same time, can you also try to apply the O(n) algorithm to
u16_strstr and u32_strstr?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]