Reduce memory usage when reading payloads that span multiple packets.#249
Conversation
3117357 to
9714b8b
Compare
|
Since the cache is now owned by the In general, this shouldn't be a problem because idle sessions will eventually get evicted from the pool (to free client and server resources). However, based on the particular workload it could be possible to get into a scenario where many large buffers are being cached longer than necessary. But it's more likely that the caching will improve performance overall for applications that retrieve a lot of large BLOBs from a database. Finally, it should be noted that Connector/NET has a similar per-connection buffer ( |
|
Shipped in 0.19.1. |
Change
ref ArraySegment<byte>toArraySegmentHolder<byte>so that a mutatedArraySegment<byte>can be passed back through a lambda function.When run with larger BLOBs (i.e., > 16MiB, the size of one packet), the test results are as follows.
ReadBlobsNewallocates 60% less data and becomes 16% faster. Other tests are essentially unchanged.Before
After