E
Eric
I need an effective way (time is my main concern here) to generate 10
000 000 unique alphanumeric strings of 16 characters each.
I used STL set and map but after about 5 000 000 entries, it becomes
very slow, even if I still have enough RAM available on my computer
Do you have any advice?
Here a code sample that I used to ensure uniqueness.
typedef pair<string, bool> StringBool_pair;
map<string, bool> MapValues;
pair<map<string,bool>::iterator,bool> pr;
for (int iii=0; iii<10000000; iii++) {
strCode = random16CharacterCode();
pr = MapValues.insert(StringBool_pair(strCode, true));
if(pr.second == true) {
// Accepted...
} else {
// Rejected...
}
}
Thank you
000 000 unique alphanumeric strings of 16 characters each.
I used STL set and map but after about 5 000 000 entries, it becomes
very slow, even if I still have enough RAM available on my computer
Do you have any advice?
Here a code sample that I used to ensure uniqueness.
typedef pair<string, bool> StringBool_pair;
map<string, bool> MapValues;
pair<map<string,bool>::iterator,bool> pr;
for (int iii=0; iii<10000000; iii++) {
strCode = random16CharacterCode();
pr = MapValues.insert(StringBool_pair(strCode, true));
if(pr.second == true) {
// Accepted...
} else {
// Rejected...
}
}
Thank you