gobwas / pool Goto Github PK
View Code? Open in Web Editor NEWGo Pooling Helpers
License: MIT License
Go Pooling Helpers
License: MIT License
Seeing the code, you are using a map
to get sync.Pool
according with their size. AFAIK the golang map
is not thread safe, or i'm wrong?
Could you please create a new release that includes the LICENSE file?
Would make the spec file for the Fedora RPM package simpler. Thanks a lot.
Hi,
Would you be so kind and tell under what license are you releasing this piece of code? It happens to be an indirect dependency for your gobwas/ws.
Cheers,
Hi,
I was benchmarking my lib which is using of gobwas/pbytes package extensively, however, during my benchamrks i found
that there is a large amount of allocation happens in pool.Put() function. I checked i didn't find anything. That is why i have asking it here maybe you could help me to find out.
github.com/gobwas/pool/pbytes.(*Pool).Put
/Users/ehsan/Dev/ronak/go/rony/vendor/github.com/gobwas/pool/pbytes/pool.go
Total: 237.51MB 237.51MB (flat, cum) 92.18%
42 . .
43 . . // Put returns given slice to reuse pool.
44 . . // It does not reuse bytes whose size is not power of two or is out of pool
45 . . // min/max range.
46 . . func (p *Pool) Put(bts []byte) {
47 237.51MB 237.51MB p.pool.Put(bts, cap(bts))
48 . . }
49 . .
50 . . // GetCap returns probably reused slice of bytes with at least capacity of n.
51 . . func (p *Pool) GetCap(c int) []byte {
52 . . return p.Get(0, c)
github.com/gobwas/pool/pbytes.(*Pool).Get
/Users/ehsan/Dev/ronak/go/rony/vendor/github.com/gobwas/pool/pbytes/pool.go
Total: 9.50MB 9.50MB (flat, cum) 3.69%
35 . . bts := v.([]byte)
36 . . bts = bts[:n]
37 . . return bts
38 . . }
39 . .
40 9.50MB 9.50MB return make([]byte, n, x)
41 . . }
42 . .
43 . . // Put returns given slice to reuse pool.
44 . . // It does not reuse bytes whose size is not power of two or is out of pool
45 . . // min/max range.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.