Hello,

I was doing some performance profiling of my ignite.NET client under load
and found that it was taking enormous time while serializing an enum field.
I'm using IBinarizable approach for serialization and my writeBinary method
looks like this:

                public void WriteBinary(IBinaryWriter writer)
                {
                        writer.WriteShort(nameof(decimalOffset), decimalOffset);
                        writer.WriteEnum(nameof(instrumentType), 
instrumentType);  //problematic
                        writer.WriteObject(nameof(marketKey), marketKey);
                        writer.WriteString(nameof(marketName), marketName);
                        writer.WriteEnum(nameof(marketType), marketType);   
//problematic
                        writer.WriteInt(nameof(priceFormat), priceFormat);
                        writer.WriteString(nameof(productCode), productCode);
                        writer.WriteString(nameof(productName), productName);
                        writer.WriteString(nameof(strategyTemplateName), 
strategyTemplateName);
                        writer.WriteDouble(nameof(tickSize), tickSize);
                }

And my InstrumentType and MarketType enums looks like this:

        [IgniteBinaryType] //Order of Enum values has to be identical to
order of Enum values in Java
        public enum InstrumentType
        {
                Undefined,
                Stock,
                Option,
                Future,
                Bond,
                Strategy,
                DNTP,
                Forex,
                ForexFW,
                Repo,
                CFD,
                TAPO,
                CDS,
                Swap,
                Forward
        }

    public enum MarketType : byte
    {
        Undefined = 0,
        Outright = 1,
        Strategy = 2,
    }

I'm also attaching a screenshot of the performance report clearly showing
that it takes around 7.5 secs and 1.3 secs  in 2 WriteEnum() methods while
under 30 miliseconds for the other fields (WriteInt(), WriteString() etc).

WriteEnum.jpg
<http://apache-ignite-users.70518.x6.nabble.com/file/t2754/WriteEnum.jpg>  

Can someone please suggest what might be causing this and how to workaround
this?




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to