Hi,
I needed to intensively use str_stri for a osm hypertext parser I am writing and I realized that it got slower the bigger the parsed strings or char buffers were. In the try of indetifying the problem I substituted all the str_stri calls by my own function and surprisingly it solved the problem. I could not believe it.

Click to reveal..

Code:
var str_stri_custom ( char *chr1, char *chr2 )
{
	var pos = 0;
	while ( *chr1 != NULL )
	{
		pos += 1;
		if ( *chr1 == *chr2 )
		{
			char *chr1b = chr1 + 1;
			char *chr2b = chr2 + 1;
			while ( ( *chr1b != NULL ) && ( *chr2b != NULL ) )
			{
				if ( *chr1b != *chr2b )
					break;
				chr1b += 1;
				chr2b += 1;
			}
			if ( *chr2b == NULL )
				return pos;
		}
		chr1 += 1;
	}
	return 0;
}