c - fwrite() performance drop -


my commands-line c-application windows uses fwrite() continuously dump received data 1 gb files on ssd drive. data comes pcie card in chunks of 16 kb, data count use when calling fwrite().

under these circumstances, each fwrite() call takes less 100 (measured using windows performance counter) but there outliers taking 2 or more seconds complete, causing buffer overflows in pcie card. what's cause of these sporadic performance drops? there can prevent them happening?

update #1: part of problem seems caused ssd drive. when dumping regular, mechanical hdd, outliers in order of 100 msecs (instead of 1000s of msecs).

update #2: seems fwrite() slowdown occurs after writing first 1.5 gb of data. when dumping 1 gb files, slowdown occurs in middle of second file. when using 512 mb files, it's after 3rd file. when using 256 mb files, it's after 6th file.

stealing something:

flash memory uses erase-write cycle. erase sets memory 1s. writing sets bits 0, , it’s possible write different data long existing 1s changed 0s. flash file systems can take advantage of feature because permits operations performed without long , electrically expensive erase cycle.

with ssd, aren't using flash file system. guess periodically need pause writing while ssd controller frees space erasing sectors.


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -