Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checksum with C binding #33

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

palainp
Copy link

@palainp palainp commented Dec 6, 2023

Hi, this PR wants to help with #31.

I tried to add a C checksum function but so far I probably have something bad in my setup as I don't see any speed difference (I probably have a bottleneck somewhere in my Linux as I run my tests locally maybe it put pressure on the local tap interface?).

Here are my tests (I used https://github.com/palainp/solo5memory as html unikernel):

# with this PR:
$ for i in `seq 1 5` ; do siege -c 1 -r 1000 "http://10.0.0.2:8080" 2>&1 | grep "Transaction rate:" ; done
Transaction rate:	     3225.81 trans/sec
Transaction rate:	     3448.28 trans/sec
Transaction rate:	     3448.28 trans/sec
Transaction rate:	     3333.33 trans/sec
Transaction rate:	     3571.43 trans/sec
# when I remove the checksum computation and test in `src/segment.ml`:
$ for i in `seq 1 5` ; do siege -c 1 -r 1000 "http://10.0.0.2:8080" 2>&1 | grep "Transaction rate:" ; done
Transaction rate:	     3333.33 trans/sec
Transaction rate:	     3333.33 trans/sec
Transaction rate:	     3225.81 trans/sec
Transaction rate:	     3571.43 trans/sec
Transaction rate:	     3571.43 trans/sec
# with the current head of utcp:
$ for i in `seq 1 5` ; do siege -c 1 -r 1000 "http://10.0.0.2:8080" 2>&1 | grep "Transaction rate:" ; done
Transaction rate:	     3333.33 trans/sec
Transaction rate:	     3333.33 trans/sec
Transaction rate:	     3333.33 trans/sec
Transaction rate:	     3225.81 trans/sec
Transaction rate:	     3225.81 trans/sec

All rates are so similar and that leads me to think about another bottleneck in my setup :(

This PR also brings a .S function that should be faster but I currently have issues embedding it into a c file and dune doesn't seem to support assembly stub files.
I still haven't done anything for the big endian version as I'm not sure that using C bindings is of much help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant