To benchmark the sha1test file I copied the flags from the standard make file of clib and placed it in the local dev makefile of sha1. It yielded the following results after I used clock to time the functions in each test:
The revised timing code can be found here for personal testing. Now we can see the majority of the time is spent in Test 6, so we are going to apply our optimization and hopefully see a change in the speed of that test. The current cflags of the standard clib Makefile are as follows:
-DCURL_STATICLIB -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__ $(shell deps/curl/bin/curl-config --cflags)
I plan on adding the -O3 optimization here. The challenge will be to either ensure that this does not affect any other dependancy or I will have to make a special case in the Makefile for only the SHA1 function.
I also plan to take out the if condition below in the sha1.c file and putting the if case in another loop.
This appears to be the only optimizations I can currently make due to the uniqueness of the sha1 implementation, if more are determined they will be applied.
The revised timing code can be found here for personal testing. Now we can see the majority of the time is spent in Test 6, so we are going to apply our optimization and hopefully see a change in the speed of that test. The current cflags of the standard clib Makefile are as follows:
-DCURL_STATICLIB -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__ $(shell deps/curl/bin/curl-config --cflags)
I plan on adding the -O3 optimization here. The challenge will be to either ensure that this does not affect any other dependancy or I will have to make a special case in the Makefile for only the SHA1 function.
I also plan to take out the if condition below in the sha1.c file and putting the if case in another loop.
This appears to be the only optimizations I can currently make due to the uniqueness of the sha1 implementation, if more are determined they will be applied.
Comments
Post a Comment