tylerjensen/ServiceWire

DateTime : Use internal ToBinary and FromBinary in SendParameters methods

fabricefou opened this issue · 2 comments

Hello,

First thanks a lot for tour library !!!
I use it with large DateTime[] and I have some performance problems.
I think using DateTime.ToBinary and FromBinary in ParameterTransferHelper.SendParameters will be more efficient that ToString().
Have you try to use it?

No. Because across the various frameworks and versions, I didn't trust the implementation to be the same. If the DateTime.ToString is a performance bottleneck for you, which seems strange as this is RPC and super chatty RPC is usually an anti-pattern, then you could use a byte array and do the conversion on client and server side outside of ServiceWire.

Ok. Thanks for your answer.
DateTime[] is 2x slower than double[] in Net framework 4.8.
Most of Time is in PipeStream.writeFileNative.
I think I will try to pass by long[] by using DateTime.Ticks.