FLAC I/O less efficient than STDIN, Direct file access can be almost twice slower than STDIN |
FLAC I/O less efficient than STDIN, Direct file access can be almost twice slower than STDIN |
Nov 26 2012, 18:26
Post
#1
|
|
![]() Group: Members Posts: 1062 Joined: 4-May 04 From: France Member No.: 13875 |
I was optimizing caudec when I came across this oddity. Basically, letting /usr/bin/flac access .flac files on a slowish HDD directly for decoding ('flac -d file.flac') was in one particular case almost twice slower than piping the files to /usr/bin/flac via STDIN ('cat file.flac | flac -d -').
I used a double album for testing, made of 37 tracks for a total of about 1 GiB, located on a HDD that tops out at about 70 MB/s. Incidentally, flac decodes on my machine at a similar rate. I ran caudec twice (figuratively - I repeated the tests many times) with 8 concurrent processes, for decoding those FLAC files to WAV on a ramdisk. I made sure to drop all caches between each run. First run was with direct file access, and completed in 40 seconds. Second run was with piping to STDIN, and completed in 25 seconds. The difference was much less pronounced, surprisingly, on a USB flash drive that tops out at 35 MB/s, 34 seconds vs. 30 seconds, and non-existant on a RAID 1 array that tops out at 130 MB/s and on a SSD that tops out at 500 MB/s. I experienced similar differences with WavPack. Does anyone have any idea of what's going on? -------------------- Save my friend from going homeless: http://outpost.fr/url/308w
|
|
|
|
![]() |
Nov 27 2012, 19:59
Post
#2
|
|
![]() Group: Members (Donating) Posts: 1983 Joined: 4-January 04 From: Austin, TX Member No.: 10933 |
Cool.
Note that --setra and --setra are completely different settings IIRC. Setting these values too high could compromise performance on other applications, so unless the drive is devoted to music, you should probably tune them down appropriately. I'm rather curious as to if you can improve performance at the default readahead values by instead tuning CFQ params. |
|
|
|
Nov 27 2012, 21:59
Post
#3
|
|
![]() Group: Members Posts: 1062 Joined: 4-May 04 From: France Member No.: 13875 |
I'm rather curious as to if you can improve performance at the default readahead values by instead tuning CFQ params. Yes: 23 seconds with CFQ/readahead at 256 (vs. 40 seconds with deadline), 17 seconds with CFQ/readahead at 16384. I completely forgot that I changed the scheduler to deadline years ago. -------------------- Save my friend from going homeless: http://outpost.fr/url/308w
|
|
|
|
Nov 28 2012, 01:20
Post
#4
|
|
![]() Group: Members (Donating) Posts: 1983 Joined: 4-January 04 From: Austin, TX Member No.: 10933 |
I'm rather curious as to if you can improve performance at the default readahead values by instead tuning CFQ params. Yes: 23 seconds with CFQ/readahead at 256 (vs. 40 seconds with deadline), 17 seconds with CFQ/readahead at 16384. I completely forgot that I changed the scheduler to deadline years ago. This post has been edited by Axon: Nov 28 2012, 01:24 |
|
|
|
skamp FLAC I/O less efficient than STDIN Nov 26 2012, 18:26
phofman Running the reading and decoding processes in para... Nov 26 2012, 19:11
Destroid I would imagine reading and writing to the same me... Nov 26 2012, 20:19
skamp QUOTE (phofman @ Nov 26 2012, 19:11) Runn... Nov 26 2012, 20:59
Destroid Ok, I see that in your third paragraph. (Pardon my... Nov 26 2012, 22:02
skamp QUOTE (Destroid @ Nov 26 2012, 22:02) If ... Nov 26 2012, 22:22
greensdrive try using just one thread for cat and the same for... Nov 26 2012, 23:16
yourlord I tested this on my machine with mostly insignific... Nov 26 2012, 23:28
skamp QUOTE (yourlord @ Nov 26 2012, 23:28) I t... Nov 26 2012, 23:42
yourlord QUOTE (skamp @ Nov 26 2012, 17:42) You le... Nov 27 2012, 01:21
Axon QUOTE (yourlord @ Nov 26 2012, 18:21) The... Nov 27 2012, 01:43
Axon You might try `blockdev --setra 65536 --setfra... Nov 27 2012, 01:32
skamp QUOTE (Axon @ Nov 27 2012, 01:32) You mig... Nov 27 2012, 02:52
Axon OP might also try tuning the I/O scheduler; see e.... Nov 27 2012, 02:46![]() ![]() |
|
Lo-Fi Version | Time is now: 23rd May 2013 - 02:50 |