jackson-core
jackson-core copied to clipboard
Use Default Buffer Size of 8K Bytes
Default buffer size is 8000 bytes which is not a power of 2. Update size to align with Java's default buffer size: 8192. The smaller buffers should be 2kb: 2048.
I've always heard that this number was chosen to be an multiple of disk sector size (4kb).
https://github.com/FasterXML/jackson-core/blob/02efa0a46f65c70e7741048a055765c9f89dc565/src/main/java/com/fasterxml/jackson/core/util/BufferRecycler.java#L80
- https://github.com/openjdk/jdk/blob/9a9add8825a040565051a09010b29b099c2e7d49/jdk/src/share/classes/java/io/BufferedInputStream.java#L53
- https://en.wikipedia.org/wiki/Disk_sector