Skip to content

philpearl/intern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A string interning library for Go

GoDoc

intern has a number of benefits

  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.
  2. It stores the strings in a way that reduces the load on the garbage collector.
  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.
i := intern.New()
hat := i.Save("hat")
fmt.Printf(i.Get(hat))

About

string interning library for lots of strings

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages