What is the cost of CreateFile ()?

I want to write data to a file often

Interestingly, I call CreateFile () every time I write it,

Does it mean as expensive as what I call once and then

use the pen many times?

+3
source share
5 answers

If you intend to write to the file several times, it would be better to save the handle returned by CreateFile (). Creating a kernel descriptor in a file will always be more inefficient if reusing the old descriptor (ceteris paribus), but there may be other considerations to consider. As always, you need to measure performance before and after to do this optimization.

+7
source

CreateFile, , ( , , , , ). - , , , , .

+2

. , . CreateFile, , , , -. , , , . , , , .

+2

. , . , CreateFile(), , .

+1

, , / . , , 100 ?

+1

Source: https://habr.com/ru/post/1710441/


All Articles