Re: [PATCH v1 4/4] hashmap: add string interning API

2014-07-07 Thread Junio C Hamano
Karsten Blees writes: > Interning short strings with high probability of duplicates can reduce the > memory footprint and speed up comparisons. > > Add strintern() and memintern() APIs that use a hashmap to manage the pool > of unique, interned strings. > > Note: strintern(getenv()) could be used

Re: [PATCH v1 4/4] hashmap: add string interning API

2014-07-03 Thread Matthieu Moy
Karsten Blees writes: > --- a/t/t0011-hashmap.sh > +++ b/t/t0011-hashmap.sh > @@ -237,4 +237,17 @@ test_expect_success 'grow / shrink' ' > > ' > > +test_expect_success 'string interning' ' > + > +test_hashmap "intern value1 > +intern Value1 > +intern value2 > +intern value2 > +" "value1 > +V

[PATCH v1 4/4] hashmap: add string interning API

2014-07-02 Thread Karsten Blees
Interning short strings with high probability of duplicates can reduce the memory footprint and speed up comparisons. Add strintern() and memintern() APIs that use a hashmap to manage the pool of unique, interned strings. Note: strintern(getenv()) could be used to sanitize git's use of getenv(),