I have a usecase where input string is a binary char buffer(0-255) and output needs to be a null terminated string to insert in a SQL database.
Currently we are using base64 encoding to encode and decode.
Encoding happens in a different thread so cost of the encoding does not impact database insert through put.
But due to legacy code limitations database read and decoding can only happen in the same thread and its reducing database read through put by ~50%(read speed without decoding vs with decoding).
The main cost is iterating through all the char of the encoded string and converting them back to original string.
Is there a batter way to do it? All I need is get rid of all the nulls from the string and get them back while reading from the database. I am on Linux x86_64 machine and portability is not much of concern now.
Aucun commentaire:
Enregistrer un commentaire