[
https://issues.apache.org/jira/browse/BEAM-14134?focusedWorklogId=745467&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-745467
]
ASF GitHub Bot logged work on BEAM-14134:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 21/Mar/22 21:46
Start Date: 21/Mar/22 21:46
Worklog Time Spent: 10m
Work Description: lukecwik edited a comment on pull request #17134:
URL: https://github.com/apache/beam/pull/17134#issuecomment-1074452530
> > I would suggest sticking with `read/writeLongViaLocalBuffer` since
read/write calls can depend on many layers of I/O before
>
> Maybe use a local byte[] for longs and read calls for everything else?
That seems consistent with what DataInputStream did as well.
It is difficult for me to say whether 4 reads will be cheaper than creating
a byte array. I wish fixed length value types could go on the stack then this
would be a no brainer but it does look like a win over allocating the 100's of
bytes for each `Data*Stream` object so I'll take your judgement call as to
whether you want arrays or multiple reads.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 745467)
Time Spent: 1h 20m (was: 1h 10m)
> Many coders cause significant unnecessary allocations
> -----------------------------------------------------
>
> Key: BEAM-14134
> URL: https://issues.apache.org/jira/browse/BEAM-14134
> Project: Beam
> Issue Type: Improvement
> Components: sdk-java-core
> Reporter: Steve Niemitz
> Assignee: Steve Niemitz
> Priority: P2
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> Many coders (BigEndian*, Map, Iterable, Instant) use DataInputStream to read
> longs/ints/shorts. Internally each DataInputStream allocates ~200 bytes of
> buffers when instantiated. This means every long, int, short, etc decoded
> allocates over 200 bytes.
> We should eliminate all uses of DataInputStream in hot-paths and replace it
> with something more efficient.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)