I have 2 functions for read files list in one directory. One uses Win32 and one uses boost: void GetFilesWin32(std::string dir) { std::vectorstd::string vFiles; std::string f = dir + "*.*"; std::string file; WIN32_FIND_DATA findFileData; HANDLE h = FindFirstFile(f.c_str(), &findFileData); if(h != INVALID_HANDLE_VALUE) { do { if((findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) { file = findFileData.cFileName; vFiles.push_back( file); } } while( FindNextFile( h, &findFileData) != 0); } FindClose(h); } void GetFilesBoost(std::string dir) { namespace fs = boost::filesystem; std::vectorstd::string vFiles; fs::path path(dir); fs::directory_iterator end_dir; for(fs::directory_iterator it(path); it != end_dir; it++) { if(!(fs::is_directory(it->status()))) { vFiles.push_back(it->path().filename().string()); } } } Boost takes 1.00 ms while Win32 taks 0.15 ms for same directory. Why? -- View this message in context: http://boost.2283326.n4.nabble.com/why-boost-is-so-slow-for-file-search-tp46... Sent from the Boost - Users mailing list archive at Nabble.com.