You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ go build bench-fsync.go
$ time ./bench-fsync
1000 fsync
real 0m22.768s
user 0m0.405s
sys 0m0.808s
$ time ./bench-fsync
1000 fsync
real 0m22.297s
user 0m0.159s
sys 0m0.571s
$ gcc -O2 bench-fsync.c
$ time ./a.out
1000 fync
real 0m0.580s
user 0m0.003s
sys 0m0.022s
$ time ./a.out
1000 fync
real 0m0.074s
user 0m0.004s
sys 0m0.030s
What did you expect to see?
Golang File IO fsync is not so slow.
What did you see instead?
Golang File IO fsync is extremely slow, compare with C.
Golang - 1000 fsync in 22 seconds
C - 1000 fsync in 0.074s seconds
The text was updated successfully, but these errors were encountered:
ideawu
changed the title
File IO fsyn(os.File.Sync) extremely slow on macOS Big Sur
File IO fsync(os.File.Sync) extremely slow on macOS Big Sur
Dec 23, 2020
What version of Go are you using (
go version
)?MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports)
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Write codes to test fsync() with Golang and C.
file: bench-fsync.go
file: bench-fsync.c
Run:
What did you expect to see?
Golang File IO fsync is not so slow.
What did you see instead?
Golang File IO fsync is extremely slow, compare with C.
The text was updated successfully, but these errors were encountered: