microsoft / go-winio

Win32 IO-related utilities for Go
MIT License
951 stars 182 forks source link

Benchmarks for os.File vs win32File? #47

Open tmm1 opened 7 years ago

tmm1 commented 7 years ago

I'm curious what kind of performance improvements can be seen when switching from *os.File to win32File for read/write operations. Are there any benchmarks available, or does anyone have anecdotal experience to share?

As far as I understand it, the advantage of win32File is that it blocks the calling goroutine on a channel instead of in a syscall, which means the go runtime needs fewer OS threads and can schedule goroutines more efficiently.

gdamore commented 6 years ago

I would expect that the underlying go runtime would use io completion ports as well, so I would be surprised to see much difference there, particularly for network sockets. (I haven't looked to see if the Go code does this, and most especially whether it does this for regular files.)

tmm1 commented 5 years ago

The go runtime uses completion ports for network sockets, but not for files on disk. My question is specifically about os.File vs win32File.