github.com/philpearl/intern@v0.0.1/README.md (about)

     1  
     2  # A string interning library for Go
     3  
     4  [![GoDoc](https://godoc.org/github.com/philpearl/intern?status.svg)](https://godoc.org/github.com/philpearl/intern)
     5  
     6  intern has a number of benefits
     7  
     8  1. It deduplicates strings. if you have data that references identical text in very many different places if may significantly reduce the amount of memory used for the strings.
     9  2. It stores the strings in a way that reduces the load on the garbage collector.
    10  3. It allows you to store an int ID for the string instead of the string itself. This is considerably smaller, and again is GC friendly.
    11  
    12  ```go
    13  i := intern.New()
    14  hat := i.Save("hat")
    15  fmt.Printf(i.Get(hat))
    16  ```