У меня есть диск с возможностью последовательной записи 1572 Мб / с
![Disk sequential and Random write and read speed](https://i.stack.imgur.com/7I8yK.png)
У меня 4 камеры с 60 кадрами в секунду.Каждый кадр не закодирован и составляет 3,7 Мб (скажем, 4 Мб) изображения.Мне нужна скорость записи 4 * 4 * 60 = 960 Мб / с.
PointGrey предоставляет примеры с кодом:
for (unsigned int uiCamera = 0; uiCamera < numCameras; uiCamera++)
{
error = retrieveImage(ppCameras[uiCamera], &image);
// error = ppCameras[uiCamera]->RetrieveBuffer(&image);
if (error != PGRERROR_OK)
{
PrintError(error);
cout << "Press Enter to exit." << endl;
cin.ignore();
return -1;
}
// Get the size of the buffer associated with the image, in bytes.
// Returns the size of the buffer in bytes.
iImageSize = image.GetDataSize();
// Write to the file
ardwBytesWritten[uiCamera] = writeFrameToFile(m_ALLCAMS, image);
};
, где:
size_t writeFrameToFile(FILE* f, Image image)
{
return fwrite(image.GetData(),
1,
image.GetCols() * image.GetRows(),
f);
}
к сожалению, я могу получить только скорость записи около 370 - 500 Мбит / с в релизережим (согласно профилировщику Windows).
writeFrameToFile - самая медленная операция, и в режиме отладки она занимает 12-13 мс.
Имеет ли смысл параллельную запись в файл, или ssd не может писать в параллельных потоках?Должен ли я использовать несколько SSD?Спасибо.