github.com/Schaudge/grailbase@v0.0.0-20240223061707-44c758a471c0/gtl/README.md (about) 1 # Poorman's Go templates 2 3 This directory contains algorithms written using a pidgin templates. 4 5 # Directory contents 6 7 - rcu_map: concurrent hash map. Readers can access the map without memory 8 barriers. 9 10 - unsafe: unsafe, but efficient slice operations, including casting between 11 string and []byte and uninitialized slice resizing. 12 13 - freepool: freepool for a concrete type. It is similar to sync.Pool, but it is 14 specialized for a particular type, and it relies on external mutex for thread 15 safety. 16 17 - randomized_freepool: thread safe freepool for a concrete type. It uses a 18 power-of-two loadbalancing to balance pools with from other CPUs, so it scales 19 better than sync.Pool on many-core machines. However, unlike sync.Pool, it 20 never releases idle objects. 21 22 # Example 23 24 Directory tests/ contains files instantiated from the templates. Grep for 25 "//go:generate" lines in this directory for the commandlines used to generate 26 these files.