SPO600 Project – glibc/string/strstr.c

My first idea was to see if the search algorithm was possible to being optimized and it seemed like it for a moment, but then I tried like 3 different ways and none of them really made an significant improvement. Then, I thought of rewriting the entire function, because I thought that it was the only way I could optimize it, but it also did not show any significant improvements. It actually made it more difficult to understand and it was a lot longer than what the function was originally. When I tried to test my version of the strstr function it ran a lot slower than the original, so I tried to make it better and I did, but it still was not better than the original.

After a couple of tries I realized that when you use the compiler optimizer already takes care of the parts that need to be optimized about the original function. Therefore, I realized that there is nothing to be done to that function at all. It made sense at that point why no one has optimized it since 2008.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s