SPO600 – Testing STRCSPN improvement

Previous post about the implementation is here : https://andreybykin.wordpress.com/2017/04/09/spo600-improving-strcspn-the-implementation/

In this post I will show the tests that I ran for my implementation of the STRCSPN function and the results of those tests.

Here is the test file that I worked with.

spnTestFile.PNG

I am unable to test my implementation as a direct compilation of the library, but this works too. The file includes a large string that we want to search in, and a smaller string with the characters we want to find a match with. I use the clock() function to time the execution of the two functions and compare the results at the end. A simple test files but it does show a slight improvement in the run time using the new implementation.

Here are some results running this test.

spnTestResult.PNG

As you can see there is a percentage of 1-1.3 improvement over the old function, this is on the X86 machine, on a AARCH64 machine the improvement bounces between 1.5-2 percent, with a similar test. This is all compiled with the default flag, playing around with -01 and -02 still shows somewhat similar results.

Again this is not much of an improvement in terms of performance however the new implementation does make the code look cleaner and easier to read. You can find the link to the implementation post above.

Leave a comment