H
Henrik Goldman
I have a collection of data consting of a time_t timestamp, a std::string
username and a hostname.
This information is read from a text file which can easily be up to 100 mb.
This means that there is a lot of records to be processed.
Until now I've been using a std::list but it seems to be too slow.
The reason why is that duplicates (e.g. same time and user and host) are not
allowed. So until now a linear search has been done to reject all duplicate
elements when inserting. This can take a lot of time though.
In order to speed it up I'm looking for good ideas. I was thinking about a
multimap which consist of time_t as first and username+hostname as second.
However it seems akward since the data is really one entity.
Maybe set is better? However it can only be better if the search speed is
faster.
Thanks.
-- Henrik
username and a hostname.
This information is read from a text file which can easily be up to 100 mb.
This means that there is a lot of records to be processed.
Until now I've been using a std::list but it seems to be too slow.
The reason why is that duplicates (e.g. same time and user and host) are not
allowed. So until now a linear search has been done to reject all duplicate
elements when inserting. This can take a lot of time though.
In order to speed it up I'm looking for good ideas. I was thinking about a
multimap which consist of time_t as first and username+hostname as second.
However it seems akward since the data is really one entity.
Maybe set is better? However it can only be better if the search speed is
faster.
Thanks.
-- Henrik