[ 
https://issues.apache.org/jira/browse/AVRO-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16859668#comment-16859668
 ] 

wangying commented on AVRO-2396:
--------------------------------

[~blachniet] hi Brian, I've tested the pull request, it works fine now. then 
the question would be, when can we expect it available in nuget? :)   I see 
it's scoped into 1.9.1. would you think it's possible to have prerelease 
version published to nuget before the full 1.9.1 is ready?

 

thanks again for following up this issue for us. it's really critical to our 
releasse.

> Huge performance regression on SpecificDatumReader for array reading
> --------------------------------------------------------------------
>
>                 Key: AVRO-2396
>                 URL: https://issues.apache.org/jira/browse/AVRO-2396
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: csharp
>    Affects Versions: 1.9.0
>            Reporter: wangying
>            Assignee: Brian Lachniet
>            Priority: Blocker
>             Fix For: 1.9.1
>
>
> The company where I'm working as a .NET developer is using Avro format for 
> message.
> Recently, after upgrade to 1.9.0-rc2 and 1.9.0-rc4, there is a hug regression 
> the read array object.
> Our test case reads a ETP defined object "Energistics.Datatypes.ChannelData" 
> inside which contains 5000 dataitems, with previous avro version, it only 
> took 300~ms to read the data, which with the last version it wooks 1+ min. 
> (the protocol can found from 
> [https://www.energistics.org/etp-developers-users/])
>  
> After look through the code, I find that should be caused by a change in 
> SpecificRecordAccess class
> public object CreateRecord(object reuse)
>  {
>  return reuse ?? ObjectCreator.Instance.New(typeName, Schema.Type.Record);
>  }
> Here, the reuse is null, thus ObjectCreator.Instance.New is run 5000 times 
> and each time use reflection to get specific types.
>  
> the previously version only do it in constructor:
> private class SpecificRecordAccess : RecordAccess
>  {
>  private ObjectCreator.CtorDelegate objCreator;
> public SpecificRecordAccess(RecordSchema readerSchema)
>  {
>  objCreator = GetConstructor(readerSchema.Fullname, Schema.Type.Record);
>  }
> public object CreateRecord(object reuse)
>  {
>  return reuse ?? objCreator();
>  }
> }
>  
> I'm trying to make a workaround and pass a reuse object in method public T 
> Read(T reuse, Decoder decoder), but still not working since the 
> SpecificDatumReader doesn't pass it through in below method.
> public void AddElements( object array, int elements, int index, ReadItem 
> itemReader, Decoder decoder, bool reuse, object reuseobj)
>  {
>  var list = (IList)array;
>  for (int i=0; i < elements; i++)
>  {
>  list.Add( itemReader(null, decoder ) );
>  }
>  }
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to