Skip to content

Commit b5c2143

Browse files
committed
Update README.md.
1 parent 327cbfb commit b5c2143

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The library provides two classes: `tsl::htrie_map` and `tsl::htrie_set`.
2424
- All operations modifying the data structure (insert, emplace, erase, ...) invalidate the iterators.
2525
- Support null characters in the key (you can thus store binary data in the trie).
2626
- Support for any type of value as long at it's either copy-constructible or both nothrow move constructible and nothrow move assignable.
27-
- The balance between speed and memory usage can be modified through `max_load_factor`. A lower max load factor will increase the speed, a higher one will reduce the memory usage. Its default value is set to 8.0.
27+
- The balance between speed and memory usage can be modified through the `max_load_factor` method. A lower max load factor will increase the speed, a higher one will reduce the memory usage. Its default value is set to 8.0.
2828
- The default burst threshold, which is the maximum size of an array hash node before a burst occurs, is set to 16 384 which provides good performances for exact searches. If you mainly use prefix searches, you may want to reduce it to something like 8 192 or 4 096 for faster iteration on the results through `burst_threshold`.
2929
- By default the maximum allowed size for a key is set to 65 535. This can be raised through the `KeySizeT` template parameter.
3030

@@ -154,7 +154,7 @@ The key are inserted and read in alphabetical order.
154154

155155
#### Dr. Askitis dataset
156156

157-
The benchmark consists in inserting all the words from the "Distinct Strings" dataset of Dr. Askitis into the data structure, check the used memory space and search for all the words from the "Skew String Set 1" dataset in the data structure. It's similar to the one on the [cedar](http://www.tkl.iis.u-tokyo.ac.jp/~ynaga/cedar/) homepage.
157+
The benchmark consists in inserting all the words from the "Distinct Strings" dataset of Dr. Askitis into the data structure, check the used memory space and search for all the words from the "Skew String Set 1" dataset (where a string can be present multiple times) in the data structure. Note that the strings in this dataset have a quite short average and median key length (which may not be a realistic use case compared to the Wikipedia dataset used above). It's similar to the one on the [cedar](http://www.tkl.iis.u-tokyo.ac.jp/~ynaga/cedar/) homepage.
158158

159159
* Dataset: [distinct_1](http://web.archive.org/web/20120206015921/http://www.naskitis.com/) (write) / [skew1_1](http://web.archive.org/web/20120206015921/http://www.naskitis.com/) (read)
160160
* Size: 290.45 MiB / 1 029.46 MiB
@@ -262,6 +262,8 @@ int main() {
262262
}
263263

264264

265+
266+
265267
tsl::htrie_map<char, int> map2 = {{"apple", 1}, {"mango", 2}, {"apricot", 3},
266268
{"mandarin", 4}, {"melon", 5}, {"macadamia", 6}};
267269

@@ -274,6 +276,15 @@ int main() {
274276
}
275277

276278

279+
// Prefix erase
280+
map2.erase_prefix("ma");
281+
282+
// {apricot, 3} {melon, 5} {apple, 1}
283+
for(auto it = map2.begin(); it != map2.end(); ++it) {
284+
std::cout << "{" << it.key() << ", " << *it << "}" << std::endl;
285+
}
286+
287+
277288

278289

279290
tsl::htrie_set<char> set = {"one", "two", "three"};

0 commit comments

Comments
 (0)