push_back(object(a,b))
to emplace_back(a, b)
).
$ cl /EHsc bar.cpp $ bar.exe C fgets, 5242880 records, 2.00438 seconds C fgets+sscanf, 5242880 records, 13.4581 seconds C++ getline, 5242880 records, 40.5704 seconds C++ extractors, 5242880 records, 92.5081 seconds $ cl /EHsc /O2 bar.cpp $ bar.exe C fgets, 5242880 records, 2.00834 seconds C fgets+sscanf, 5242880 records, 13.5875 seconds C++ getline, 5242880 records, 3.56614 seconds C++ extractors, 5242880 records, 41.97 seconds |
Maybe so, but the elephant in the room is the god-awful slowness of parsing the data once it's in memory. Shaving a few uS off the time by memory mapping the file directly ain't gonna change that. |
|
|
|
|
while (dataFile >> d.date >> d.time >> d.mil >> c >> d.last >> c >> d.bid >> c >> d.ask >> c >> d.volume)
msvcp140.dll!0x007ffbf050849f |
msvcp140.dll!0x007ffbf0506bef |