Hi, In case someone is interested, else please ignore (just sending on public domain for other people if they do web search) [Tested on latest glibc - glibc-2.33]. I have done final testing with long needles. I modified bench-strstr.c and included my algorithm in it. Attached are the diff, analysis.xlsx, and original bench-strstr.out. Below is my code: ============================================================================================== // Choudhary algorithm static char * chal(char *text, char *pattern) { #define false 0 #define true 1 #define ALPHABET_SIZE 256 long i = 0; long index = 0; long end_index = 0; int not_found = false; long text_len = strlen(text); long pattern_len = strlen(pattern); long pi_44 = pattern_len - 1; long pi_34 = (3 * pattern_len) / 4; long pi_24 = pattern_len / 2; long pi_14 = pattern_len / 4; long fps = 0; long skip_table[ALPHABET_SIZE] = {0}; // preprocess pattern and fill skip_table for (i = 0; i < pattern_len; i++) { skip_table[(int)(pattern[i])] = pattern_len - 1 - i; } // now search for (i = 0; i < text_len; i++) { if ((text_len - i) < pattern_len) { //printf("\tfps = %ld\n", fps); return NULL; //return -1; } if (pattern[pi_44] != text[i + pi_44]) { if (skip_table[(int)(text[i + pi_44])] > 0) { i = i + skip_table[(int)(text[i + pi_44])] - 1; } continue; } if (pattern[0] != text[i]) { continue; } if (pattern[pi_24] != text[i + pi_24]) { continue; } if (pattern[pi_34] != text[i + pi_34]) { continue; } if (pattern[pi_14] != text[i + pi_14]) { continue; } fps = fps + 1; end_index = i + pi_44; not_found = false; for (index = i; index <= end_index; index++) { if (text[index] != pattern[index - i]) { not_found = true; break; } } // end of inner for loop if (not_found == false) { // match is found //printf("\tfps = %ld\n", fps); return (text + i); //return i; } } // end of outer for loop //printf("\tfps = %ld\n", fps); return NULL; //return -1; } // end of chal ============================================================================================== Amit