Commit Graph

26 Commits

Author SHA1 Message Date
Kirill Danshin 10f802b4cd implement String() method. closes #7 (#8)
* implement String() method. closes #7

* String() - lower memory usage
2016-07-12 09:10:16 +03:00
Albert a517d2d153 Fix typo (#6) 2016-07-01 22:46:08 +03:00
Aliaksandr Valialkin 21a4b21155 Implement io.ReaderFrom 2016-06-29 18:32:31 +03:00
Aliaksandr Valialkin 18b5603df3 Added io.WriterTo implementation to ByteBuffer 2016-06-29 17:48:49 +03:00
Albert bf51c4698b Small refactoring (#4)
* Move some methods to pool.go

* Use method instead of manual resetting of buffer

* Fix typo
2016-06-28 22:46:18 +03:00
Aliaksandr Valialkin a3c01bbe26 Clarified that the bytebufferpool purpose is anti-memory-waste protection 2016-06-27 16:11:40 +03:00
Aliaksandr Valialkin fd4be3f08f Issue #1: clarified the comment regarding CPU cache line size 2016-06-27 16:07:21 +03:00
Aliaksandr Valialkin c0dbba6832 Small code clarifications after #2 and #3 2016-06-27 16:05:21 +03:00
Albert c57419c995 Add Bytes function (#3) 2016-06-27 16:00:15 +03:00
Albert 21e406c403 Add WriteByte function (#2) 2016-06-27 15:59:55 +03:00
Aliaksandr Valialkin 928aed2629 Renaming: Acquire->Get, Release->Put for the sake of the consistency with standard package 2016-06-24 14:57:35 +03:00
Aliaksandr Valialkin 5dec51fcf9 optimized index calculation 2016-06-24 14:46:58 +03:00
Aliaksandr Valialkin b48200dc4a Return all the byte buffers to the pool until the first calibration 2016-06-24 14:18:14 +03:00
Aliaksandr Valialkin ea471ff2ce Do not return buffers with too big capacity to the pool 2016-06-23 22:41:46 +03:00
Aliaksandr Valialkin a1c2e6cf76 Revert "Return back pools segementation by size".
This reverts commit 08eb8e13d0,
since it led to high memory usage on the production box.

The commit need additional investigation.
2016-06-23 22:19:16 +03:00
Aliaksandr Valialkin 08eb8e13d0 Return back pools segementation by size 2016-06-23 22:07:48 +03:00
Aliaksandr Valialkin da2b103f14 Removed debug logging 2016-06-23 20:59:29 +03:00
Aliaksandr Valialkin 1dbe0d3c7d Drop buffers with sizes greater than 95% percentile 2016-06-23 20:58:48 +03:00
Aliaksandr Valialkin c0dd811f50 Atomically load pool indexes 2016-06-23 19:20:57 +03:00
Aliaksandr Valialkin 5f9190a306 Allocate from the most frequently used pool 2016-06-23 19:08:27 +03:00
Aliaksandr Valialkin ee98c9419f Keep zero-length buffers in the pool 2016-06-23 17:43:05 +03:00
Aliaksandr Valialkin 7e712dfeb6 Drop buffers with under-used capacity in order to reduce memory waste 2016-06-23 15:09:07 +03:00
Aliaksandr Valialkin 164e50ac3f renaming: AcquireByteBuffer -> Acquire, ReleaseByteBuffer -> Release 2016-06-23 11:07:55 +03:00
Aliaksandr Valialkin e8ad8e40ca Formatting fix 2016-06-22 20:47:40 +03:00
Aliaksandr Valialkin 2cfa228f2b Mention that fasthttp and quicktemplate use bytebufferpool 2016-06-22 20:39:15 +03:00
Aliaksandr Valialkin 21bf76e6cc Initial implementation 2016-06-22 20:28:05 +03:00