Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Reviewed
Description
DFSUtil.byteArray2PathString generates excessive object allocation.
- each byte array is encoded to a string (copy)
- string appended to a builder which extracts the chars from the intermediate string (copy) and adds to its own char array
- builder's char array is re-alloced if over 16 chars (copy)
- builder's toString creates another string (copy)
Instead of allocating all these objects and performing multiple byte/char encoding/decoding conversions, the byte array can be built in-place with a single final conversion to a string.
Attachments
Attachments
Issue Links
- requires
-
HDFS-10655 Fix path related byte array conversion bugs
- Resolved