c# - Cast int to char array without impacting heap -
i need convert int byte array in micro framework can streamed serial. happening in time-sensitive area of code delay caused garbage collector take long.
normally i’d cast int string , thence char array. creates heap object risks garbage collection.
is there efficient way this? can in loop uses modulo 10 arithmetic slow. in c i've used sprintf convert pre-allocated array, fine.
you can use bitconverter such tasks.
but i'd advise take @ protobuf if need squeeze every ounce of space/performance serialized binary. there's hardly better/faster way serialize data binary blobs. able send on wire or save disk, or store in memory caching purposes.
Comments
Post a Comment