Giter Club home page Giter Club logo

pool's People

Contributors

gobwas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pool's Issues

Is it thread safe?

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?

New release

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.

Unknown license

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,

Large memory allocation on pools.Put

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. 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.