neo4j / neo4j-go-driver

Neo4j Bolt Driver for Go
Apache License 2.0
496 stars 70 forks source link

Buffered reading. #581

Closed thelonelyvulpes closed 4 months ago

thelonelyvulpes commented 6 months ago

This change introduces a buffered reader between the racing reader and the connection to reduce the number of syscalls required to read messages.

The size of the read buffer is configurable on the driver.

Assuming a 16KB Buffer for 100 connections on 3 servers that would equal 16KB 100 3 = ~5MB. N.b. that 300 connections would indicate a very busy client and 5MB should be considered a relatively small increased footprint.

The default read buffer size is: 32K?

StephenCathcart commented 5 months ago

Tests failing due to bufio.Reader not being thread-safe.

Tests fixed