chrisidefix / libtorrent

Automatically exported from code.google.com/p/libtorrent
0 stars 0 forks source link

Skip zero-filling on Full Allocation (on NTFS-Windows) #576

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The main problem when using any torrent client in windows based on libtorrent 
is the allocation.

There's two mods of allocations in libtorrent, one is spares which cause way 
too much of fragmentation, the other is full allocation which prevents 
fragmentation completely. 
Then, when you try to download a 40 GB file with full allocation the client 
will first zero-fill the hdd with 40GB of zeros which will take long time.
On the other hand on ext3/4 the write of the data starts right away unlike on 
NTFS.

Thus uTorrent managed to overcome this issue by making the option: 
"diskio.no_zero - Enabling this option causes µTorrent to skip the 
zero-filling process for file allocation"
http://www.netcheif.com/Articles/uTorrent/html/AppendixA_02_12.html#diskio.no_ze
ro

In the end, on windows with NTFS file system when downloading a big torrent 
with uTorrent you're able to download it right away and you dont get any 
fragmentation what so ever, while using a client based on libtorrent you'll 
have to wait very long time before you're able to start writing all the data on 
the drive which makes it very annoying, though i wanna use libtorrent based 
clients.

I wonder if it's possible to make the same option on libtorrent that when you 
use full allocation to be able to skip the zero filling stage just like in 
uTorrent?

Original issue reported on code.google.com by Class...@gmail.com on 4 Feb 2014 at 7:03

GoogleCodeExporter commented 9 years ago
here's the CSV if you want to take a closer look:

http://www56.zippyshare.com/v/39722177/file.html

Original comment by Class...@gmail.com on 23 Feb 2014 at 9:41

GoogleCodeExporter commented 9 years ago
I may have build it with a revision not containing the fix. It seems that 
RC_0_16 is at 9740 now. I'll redo it.

Original comment by hammered...@gmail.com on 23 Feb 2014 at 9:46

GoogleCodeExporter commented 9 years ago
hehe, cool :)

Original comment by Class...@gmail.com on 23 Feb 2014 at 9:46

GoogleCodeExporter commented 9 years ago
Here is version with r9738: 
http://builds.shiki.hu/temp/qbittorrent_3.2.0alpha23022014_0303d2bf5566_libtorre
ntr9738_setup.exe

Original comment by hammered...@gmail.com on 23 Feb 2014 at 10:15

GoogleCodeExporter commented 9 years ago
I'm on it.

Original comment by Class...@gmail.com on 23 Feb 2014 at 10:16

GoogleCodeExporter commented 9 years ago
WHHOOOOHOOOOOOOOOOO, its working :D 

"12:19:37.4311796 
AM","qbittorrent.exe","12372","CreateFile","D:\Downloads\ubuntu-12.04.4-dvd-amd6
4.iso","SUCCESS","Desired Access: Generic Read/Write, Disposition: OpenIf, 
Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: N, 
ShareMode: Read, AllocationSize: 0, OpenResult: Created"
"12:19:37.4312928 
AM","qbittorrent.exe","12372","CreateFileMapping","D:\Downloads\ubuntu-12.04.4-d
vd-amd64.iso","FILE LOCKED WITH WRITERS","SyncType: SyncTypeCreateSection, 
PageProtection: "
"12:19:37.4312993 
AM","qbittorrent.exe","12372","QueryStandardInformationFile","D:\Downloads\ubunt
u-12.04.4-dvd-amd64.iso","SUCCESS","AllocationSize: 0, EndOfFile: 0, 
NumberOfLinks: 1, DeletePending: False, Directory: False"
"12:19:37.4313347 
AM","qbittorrent.exe","12372","QueryStandardInformationFile","D:\Downloads\ubunt
u-12.04.4-dvd-amd64.iso","SUCCESS","AllocationSize: 0, EndOfFile: 0, 
NumberOfLinks: 1, DeletePending: False, Directory: False"
"12:19:37.4313432 
AM","qbittorrent.exe","12372","SetEndOfFileInformationFile","D:\Downloads\ubuntu
-12.04.4-dvd-amd64.iso","SUCCESS","EndOfFile: 1,758,167,040"
"12:19:37.4314274 
AM","qbittorrent.exe","12372","SetAllocationInformationFile","D:\Downloads\ubunt
u-12.04.4-dvd-amd64.iso","SUCCESS","AllocationSize: 1,758,167,040"
"12:19:37.4314576 
AM","qbittorrent.exe","12372","SetValidDataLengthInformationFile","D:\Downloads\
ubuntu-12.04.4-dvd-amd64.iso","SUCCESS","ValidDataLength: 1,758,167,040"

Original comment by Class...@gmail.com on 23 Feb 2014 at 10:22

GoogleCodeExporter commented 9 years ago
So if its now on the SVN, it means it would be on qbittorrent stable release 
very soon :)

I appreciate all your help, of both of you!
Thanks a lot for helping me help and improve libtorrent :)

Original comment by Class...@gmail.com on 24 Feb 2014 at 2:21

GoogleCodeExporter commented 9 years ago
thank you very much for your help and patience!

Original comment by arvid.no...@gmail.com on 28 Feb 2014 at 5:19