You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by zork <pr...@gmail.com> on 2020/07/15 07:16:47 UTC

Performance Issue with Enum Serialization in Ignite 2.8

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/

Re: Performance Issue with Enum Serialization in Ignite 2.8

Posted by Pavel Tupitsyn <pt...@apache.org>.
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 <pt...@apache.org>
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 <pr...@gmail.com> 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

Posted by Pavel Tupitsyn <pt...@apache.org>.
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 <pr...@gmail.com> 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

Posted by zork <pr...@gmail.com>.
Can someone provide inputs on this please?



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