phuslu / log

Fastest structured logging
MIT License
672 stars 44 forks source link

FileWriter should be lockfree #9

Closed phuslu closed 4 years ago

phuslu commented 4 years ago

*os.File.Write already has a lock for concurrency call. so we could remove current mutex of FileWriter. A original but outdated implementation reverted at b6dc7fe61591143f5ac8100ec865ef8ade52df9d

phuslu commented 4 years ago

a initial file_fast.go added https://github.com/phuslu/log/blob/master/file_fast.go

phuslu commented 4 years ago

a internal review finished. will rename FastFileWriter to FileWriter in future

phuslu commented 4 years ago

UPDATE: benchmark show there's only a little performance improvement. so revert at https://github.com/phuslu/log/commit/2acff7345f917d87c69f6ca1a08f9f8cb8dbadf5 and close this issue

phuslu commented 4 years ago

reopen for future investigating