dCache / xrootd4j

Implementation of the xrootd data access protocol in Java
Other
3 stars 8 forks source link

xrootd4j: do not reallocate and copy into new direct buffer on write … #139

Closed alrossi closed 2 years ago

alrossi commented 2 years ago

…request

Motivation:

The decoder for incoming requests uses the default bytebuf allocator to create the frame buffer; this default prefers direct memory. It is thus unnecessary, when receiving data to be written to disk, to reallocate a direct buffer (alloc().ioBuffer(...)) and write the data from the frame buffer to it.

Modification:

Use a retainedSlice to preserve the data portion of the frame buffer and assign it to the data field.

Result:

This should somewhat optimize write.

No observable change to user.

Target: master Patch: https://rb.dcache.org/r/13633/ Acked-by: Lea Acked-by: Dmitry Request: 4.4 Requires-notes: yes Requires-book: no