Topic: low latency single threaded app
i have a c++ single-threaded app that uses wolfssl c library for the tls
the app receives data on existing connections and constantly closes and creates new connections
i have benchmarked the app and noticed that the
wolfSSL_connect
function takes about 400 microseconds (btw i have setup the library to not check certificates), which means my messages get delayed by up to 400 microseconds, i create a lot of new connections which means a lot of spikes
i have lightly gone over the code in wolfssl and i have seen a lot of situations where there is a switch with cases like:
TLS_ASYNC_BEGIN
TLS_ASYNC_BUILD
TLS_ASYNC_DO
TLS_ASYNC_VERIFY
TLS_ASYNC_FINALIZE
between them there is
FALL_THROUGH;
what i want is to remove the fallthrough or to return so that the wolfssl function is basically broken into multiple pieces, which might only cause 50 microseconds (or even less)
i would then have to call it more times and it obviously take longer to create a new connection, but i don't care because it would not impact the latency of the messages of my existing connection
---
it seems like a big undertaking though, and i would like some help/advice
is there an easy solution for what i want that i am just not seeing?
if not:
is there some documentation specifically for this case?
what are the things that i should watch out for?
is there some specific approach that i should take?
thank you in advance