Re: Performance Issue with Enum Serialization in Ignite 2.8

2020-07-23 Thread Pavel Tupitsyn
I can confirm the performance issue with enum serialization.
Ticket filed [1], I'm working on it.

The only workaround I can offer is to avoid WriteEnum for now.
Use WriteInt instead, add type casts accordingly.

[1] https://issues.apache.org/jira/browse/IGNITE-13293

On Thu, Jul 23, 2020 at 12:53 PM Pavel Tupitsyn 
wrote:

> I'll have a look today and get back to you.
> Sorry, I did not notice this thread until now.
>
> On Thu, Jul 23, 2020 at 7:27 AM zork  wrote:
>
>> Can someone provide inputs on this please?
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
>


Re: Performance Issue with Enum Serialization in Ignite 2.8

2020-07-23 Thread Pavel Tupitsyn
I'll have a look today and get back to you.
Sorry, I did not notice this thread until now.

On Thu, Jul 23, 2020 at 7:27 AM zork  wrote:

> Can someone provide inputs on this please?
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>


Re: Performance Issue with Enum Serialization in Ignite 2.8

2020-07-22 Thread zork
Can someone provide inputs on this please?



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


Performance Issue with Enum Serialization in Ignite 2.8

2020-07-15 Thread zork
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
  

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




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