I have made two classes that use basically the same exact ways of doing things, but I cant seem to figure out which one is faster to use.
I am only going to show my variables for the classes cause there are alot of prototypes in the classes.
and this is the other classCode:class MusicPlayer { public: //Functions private: //Variables std::map<std::string, std::string> name_; std::map<std::string, int> songnumber_; std::map<std::string, int> songlengthMS_; //other vars };
Questions:Code:class MusicPlayer { public: //Functions private: //Variables std::vector<std::string> name_; std::vector<int> songnumber_; std::vector<int> songlengthMS_; //other vars };
1) Which is faster
2) Which is (opinion) more memory efficient
3) Is there maybe a even better way to do this?
those are the two classes. I want to figure out which one is faster when using a relatively large amount of files. ( between 300-1000 ). Thank you for any assistance or help you may provide.



LinkBack URL
About LinkBacks


