Author

Topic: svn rev 181, 182 and 183 (Read 1128 times)

hero member
Activity: 812
Merit: 1022
No Maps for These Territories
November 18, 2010, 04:11:46 AM
#2
The problem was Bitcoin opening and then closing the debug.log file on every write.  After a couple of "too clever for my own good" solutions that broke, or could break, in interesting ways, the code now opens debug.log and simply keeps it open, constantly appending to it.
Indeed, fflush is good enough to make sure the data gets written, constantly reopening/closing the file won't do anything beyond that.
legendary
Activity: 1652
Merit: 2216
Chief Scientist
November 17, 2010, 08:24:45 PM
#1
It'd been a while since I shot myself in my foot, so I guess I was overdue.

Anyhow, on my third attempt I think I've got it right-- I fixed a bug that was causing Bitcoin to be unusably slow on Macs running FileVault (the built-in filesystem encryption on the Mac).

The problem was Bitcoin opening and then closing the debug.log file on every write.  After a couple of "too clever for my own good" solutions that broke, or could break, in interesting ways, the code now opens debug.log and simply keeps it open, constantly appending to it.

If you run a bitcoind server, see the "don't forget to rotate your logs" thread for what you need to do for log rotation to work properly.
Jump to: