Skip to content

Commit

Permalink
perf: nocopy read for ReadString and ReadBinary API if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
joway committed Mar 1, 2024
1 parent 7ba622b commit 200399d
Show file tree
Hide file tree
Showing 5 changed files with 906 additions and 873 deletions.
19 changes: 13 additions & 6 deletions nocopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,17 @@ func NewIOReadWriter(rw ReadWriter) io.ReadWriter {
}

const (
block1k = 1 * 1024
block2k = 2 * 1024
block4k = 4 * 1024
block8k = 8 * 1024
)
block1k = 1 * 1024
block2k = 2 * 1024
block4k = 4 * 1024
block8k = 8 * 1024
block32k = 32 * 1024

pagesize = block8k

const pagesize = block8k
defaultLinkBufferMode = 1 << 0
// reuse mode, indicate weather reuse buffer node data, default true
reuseMask uint8 = 1 << 0 // 0000 0001
// read-only mode, introduced by Refer, WriteString, WriteBinary, etc., default false
readonlyMask uint8 = 1 << 1 // 0000 0010
)
Loading

0 comments on commit 200399d

Please sign in to comment.