-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Labels
PerformanceIssues related to performance concerns.Issues related to performance concerns.
Description
Problem
Codec.toBytes() creates an instance of ByteArrayOutputStream() which in turn creates default byte[32] in its constructor.
Every time the current capacity is exhausted the underlying array is doubled in size and copied over, which has visible performance impact. That could be avoided by properly sizing the instance at creation.
Solution
Either a better default size could be used universally (256? 512?) or the actual size of item could be computed and passed to ByteArrayOutputStream(int). Performance effect of either solution should be evaluated.
Alternatives
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PerformanceIssues related to performance concerns.Issues related to performance concerns.