namecoin / namecoin-legacy

Legacy client. New version here: https://github.com/namecoin/namecoin-core Note the release branch! - Official website:
https://namecoin.org
MIT License
448 stars 177 forks source link

Improve disk fragmentation of block files #141

Closed domob1812 closed 10 years ago

domob1812 commented 10 years ago

This is a port of https://github.com/chronokings/huntercoin/pull/66. The patch changes adding to the block files (blk????.dat) to be done in chunks of 16 MiB, which decreases file system fragmentation and is (I have heard) a big improvement especially on NTFS systems.

It has been tested already a while in Huntercoin, and I'm running a sync from scratch with this patch applied right now. It correctly allocates the file in chunks, and is already at block 20k. So it seems to work - but it would be cool to get more testing results, especially on Windows with NTFS.

phelixbtc commented 10 years ago

Great! This should help disk based drives a lot.

phelixbtc commented 10 years ago

I ran a comparison: Full blockchain download with direct local connection after system defragmentation. Windows, NTFS, i3 with disk based HD. Duration [h:mm]: 2:17 vs. 1:39 Fragments: blk0001.dat: 50821 vs. 62 blkindex.dat: 3420 vs. 320 Looks good! Interesting to see that the patch also helps with the other files. ACK.

domob1812 commented 10 years ago

Thanks for the timing - this is very interesting to know! :) BTW, I think also the Bitcoin devs discussed a change like this some time ago. Snailbrain dug out a link, but I don't have it at hand right now.

phelixbtc commented 10 years ago

Has this been tested enough? I have been running it ever since and did not notice any problems. Domob, do you feel comfortable with merging?

domob1812 commented 10 years ago

As far as I know, it has been running quite a while for Huntercoin without problems. The same for me. So if it also works for you on Windows and shows improvements, I think it should be fine to merge.