[jira] [Updated] (AVRO-2056) DirectBinaryEncoder Creates Buffer For Each Call To writeDouble
[ https://issues.apache.org/jira/browse/AVRO-2056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gabor Szadovszky updated AVRO-2056: --- Resolution: Fixed Fix Version/s: 1.9.0 Status: Resolved (was: Patch Available) > DirectBinaryEncoder Creates Buffer For Each Call To writeDouble > --- > > Key: AVRO-2056 > URL: https://issues.apache.org/jira/browse/AVRO-2056 > Project: Avro > Issue Type: Improvement > Components: java >Affects Versions: 1.7.7, 1.8.2 >Reporter: BELUGA BEHR >Assignee: BELUGA BEHR >Priority: Minor > Fix For: 1.9.0 > > Attachments: AVRO-2056.1.patch > > > Each call to {{writeDouble}} creates a new buffer and promptly throws it away > even though the class has a re-usable buffer and is used in other methods > such as {{writeFloat}}. Remove this extra buffer. > {code:title=org.apache.avro.io.DirectBinaryEncoder} > // the buffer is used for writing floats, doubles, and large longs. > private final byte[] buf = new byte[12]; > @Override > public void writeFloat(float f) throws IOException { > int len = BinaryData.encodeFloat(f, buf, 0); > out.write(buf, 0, len); > } > @Override > public void writeDouble(double d) throws IOException { > byte[] buf = new byte[8]; > int len = BinaryData.encodeDouble(d, buf, 0); > out.write(buf, 0, len); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (AVRO-2056) DirectBinaryEncoder Creates Buffer For Each Call To writeDouble
[ https://issues.apache.org/jira/browse/AVRO-2056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] BELUGA BEHR updated AVRO-2056: -- Status: Patch Available (was: In Progress) > DirectBinaryEncoder Creates Buffer For Each Call To writeDouble > --- > > Key: AVRO-2056 > URL: https://issues.apache.org/jira/browse/AVRO-2056 > Project: Avro > Issue Type: Improvement > Components: java >Affects Versions: 1.8.2, 1.7.7 >Reporter: BELUGA BEHR >Assignee: BELUGA BEHR >Priority: Minor > Attachments: AVRO-2056.1.patch > > > Each call to {{writeDouble}} creates a new buffer and promptly throws it away > even though the class has a re-usable buffer and is used in other methods > such as {{writeFloat}}. Remove this extra buffer. > {code:title=org.apache.avro.io.DirectBinaryEncoder} > // the buffer is used for writing floats, doubles, and large longs. > private final byte[] buf = new byte[12]; > @Override > public void writeFloat(float f) throws IOException { > int len = BinaryData.encodeFloat(f, buf, 0); > out.write(buf, 0, len); > } > @Override > public void writeDouble(double d) throws IOException { > byte[] buf = new byte[8]; > int len = BinaryData.encodeDouble(d, buf, 0); > out.write(buf, 0, len); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (AVRO-2056) DirectBinaryEncoder Creates Buffer For Each Call To writeDouble
[ https://issues.apache.org/jira/browse/AVRO-2056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] BELUGA BEHR updated AVRO-2056: -- Status: In Progress (was: Patch Available) > DirectBinaryEncoder Creates Buffer For Each Call To writeDouble > --- > > Key: AVRO-2056 > URL: https://issues.apache.org/jira/browse/AVRO-2056 > Project: Avro > Issue Type: Improvement > Components: java >Affects Versions: 1.8.2, 1.7.7 >Reporter: BELUGA BEHR >Assignee: BELUGA BEHR >Priority: Minor > Attachments: AVRO-2056.1.patch > > > Each call to {{writeDouble}} creates a new buffer and promptly throws it away > even though the class has a re-usable buffer and is used in other methods > such as {{writeFloat}}. Remove this extra buffer. > {code:title=org.apache.avro.io.DirectBinaryEncoder} > // the buffer is used for writing floats, doubles, and large longs. > private final byte[] buf = new byte[12]; > @Override > public void writeFloat(float f) throws IOException { > int len = BinaryData.encodeFloat(f, buf, 0); > out.write(buf, 0, len); > } > @Override > public void writeDouble(double d) throws IOException { > byte[] buf = new byte[8]; > int len = BinaryData.encodeDouble(d, buf, 0); > out.write(buf, 0, len); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (AVRO-2056) DirectBinaryEncoder Creates Buffer For Each Call To writeDouble
[ https://issues.apache.org/jira/browse/AVRO-2056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] BELUGA BEHR updated AVRO-2056: -- Attachment: AVRO-2054.2.patch Renamed the automatic variable from _buffer_ to _builder_. > DirectBinaryEncoder Creates Buffer For Each Call To writeDouble > --- > > Key: AVRO-2056 > URL: https://issues.apache.org/jira/browse/AVRO-2056 > Project: Avro > Issue Type: Improvement > Components: java >Affects Versions: 1.7.7, 1.8.2 >Reporter: BELUGA BEHR >Assignee: BELUGA BEHR >Priority: Minor > Attachments: AVRO-2056.1.patch > > > Each call to {{writeDouble}} creates a new buffer and promptly throws it away > even though the class has a re-usable buffer and is used in other methods > such as {{writeFloat}}. Remove this extra buffer. > {code:title=org.apache.avro.io.DirectBinaryEncoder} > // the buffer is used for writing floats, doubles, and large longs. > private final byte[] buf = new byte[12]; > @Override > public void writeFloat(float f) throws IOException { > int len = BinaryData.encodeFloat(f, buf, 0); > out.write(buf, 0, len); > } > @Override > public void writeDouble(double d) throws IOException { > byte[] buf = new byte[8]; > int len = BinaryData.encodeDouble(d, buf, 0); > out.write(buf, 0, len); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (AVRO-2056) DirectBinaryEncoder Creates Buffer For Each Call To writeDouble
[ https://issues.apache.org/jira/browse/AVRO-2056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] BELUGA BEHR updated AVRO-2056: -- Attachment: (was: AVRO-2054.2.patch) > DirectBinaryEncoder Creates Buffer For Each Call To writeDouble > --- > > Key: AVRO-2056 > URL: https://issues.apache.org/jira/browse/AVRO-2056 > Project: Avro > Issue Type: Improvement > Components: java >Affects Versions: 1.7.7, 1.8.2 >Reporter: BELUGA BEHR >Assignee: BELUGA BEHR >Priority: Minor > Attachments: AVRO-2056.1.patch > > > Each call to {{writeDouble}} creates a new buffer and promptly throws it away > even though the class has a re-usable buffer and is used in other methods > such as {{writeFloat}}. Remove this extra buffer. > {code:title=org.apache.avro.io.DirectBinaryEncoder} > // the buffer is used for writing floats, doubles, and large longs. > private final byte[] buf = new byte[12]; > @Override > public void writeFloat(float f) throws IOException { > int len = BinaryData.encodeFloat(f, buf, 0); > out.write(buf, 0, len); > } > @Override > public void writeDouble(double d) throws IOException { > byte[] buf = new byte[8]; > int len = BinaryData.encodeDouble(d, buf, 0); > out.write(buf, 0, len); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (AVRO-2056) DirectBinaryEncoder Creates Buffer For Each Call To writeDouble
[ https://issues.apache.org/jira/browse/AVRO-2056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] BELUGA BEHR updated AVRO-2056: -- Affects Version/s: 1.7.7 1.8.2 > DirectBinaryEncoder Creates Buffer For Each Call To writeDouble > --- > > Key: AVRO-2056 > URL: https://issues.apache.org/jira/browse/AVRO-2056 > Project: Avro > Issue Type: Improvement > Components: java >Affects Versions: 1.7.7, 1.8.2 >Reporter: BELUGA BEHR >Assignee: BELUGA BEHR >Priority: Minor > Attachments: AVRO-2056.1.patch > > > Each call to {{writeDouble}} creates a new buffer and promptly throws it away > even though the class has a re-usable buffer and is used in other methods > such as {{writeFloat}}. Remove this extra buffer. > {code:title=org.apache.avro.io.DirectBinaryEncoder} > // the buffer is used for writing floats, doubles, and large longs. > private final byte[] buf = new byte[12]; > @Override > public void writeFloat(float f) throws IOException { > int len = BinaryData.encodeFloat(f, buf, 0); > out.write(buf, 0, len); > } > @Override > public void writeDouble(double d) throws IOException { > byte[] buf = new byte[8]; > int len = BinaryData.encodeDouble(d, buf, 0); > out.write(buf, 0, len); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (AVRO-2056) DirectBinaryEncoder Creates Buffer For Each Call To writeDouble
[ https://issues.apache.org/jira/browse/AVRO-2056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] BELUGA BEHR updated AVRO-2056: -- Attachment: AVRO-2056.1.patch > DirectBinaryEncoder Creates Buffer For Each Call To writeDouble > --- > > Key: AVRO-2056 > URL: https://issues.apache.org/jira/browse/AVRO-2056 > Project: Avro > Issue Type: Improvement > Components: java >Reporter: BELUGA BEHR >Priority: Minor > Attachments: AVRO-2056.1.patch > > > Each call to {{writeDouble}} creates a new buffer and promptly throws it away > even though the class has a re-usable buffer and is used in other methods > such as {{writeFloat}}. Remove this extra buffer. > {code:title=org.apache.avro.io.DirectBinaryEncoder} > // the buffer is used for writing floats, doubles, and large longs. > private final byte[] buf = new byte[12]; > @Override > public void writeFloat(float f) throws IOException { > int len = BinaryData.encodeFloat(f, buf, 0); > out.write(buf, 0, len); > } > @Override > public void writeDouble(double d) throws IOException { > byte[] buf = new byte[8]; > int len = BinaryData.encodeDouble(d, buf, 0); > out.write(buf, 0, len); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (AVRO-2056) DirectBinaryEncoder Creates Buffer For Each Call To writeDouble
[ https://issues.apache.org/jira/browse/AVRO-2056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] BELUGA BEHR updated AVRO-2056: -- Status: Patch Available (was: Open) > DirectBinaryEncoder Creates Buffer For Each Call To writeDouble > --- > > Key: AVRO-2056 > URL: https://issues.apache.org/jira/browse/AVRO-2056 > Project: Avro > Issue Type: Improvement > Components: java >Reporter: BELUGA BEHR >Assignee: BELUGA BEHR >Priority: Minor > Attachments: AVRO-2056.1.patch > > > Each call to {{writeDouble}} creates a new buffer and promptly throws it away > even though the class has a re-usable buffer and is used in other methods > such as {{writeFloat}}. Remove this extra buffer. > {code:title=org.apache.avro.io.DirectBinaryEncoder} > // the buffer is used for writing floats, doubles, and large longs. > private final byte[] buf = new byte[12]; > @Override > public void writeFloat(float f) throws IOException { > int len = BinaryData.encodeFloat(f, buf, 0); > out.write(buf, 0, len); > } > @Override > public void writeDouble(double d) throws IOException { > byte[] buf = new byte[8]; > int len = BinaryData.encodeDouble(d, buf, 0); > out.write(buf, 0, len); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)