View Single Post
  #656  
Old 06-09-2023, 10:56
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,749
Thanks: 2,170
Thanked 11,206 Times in 2,307 Posts
Razor12911 is on a distinguished road
There's two different code sets for decoding in xtool, one is for multi threading which caters for speed at a cost of increased memory usage because the streams have to be reorganised before they are written to disk and as such, high memory usage because they are stored in memory first. The other code is when you have set 1 thread of if a block has 1 stream in it, for this as soon as a stream is processed, it is written to disk hence why the reduced memory usage in -t1.

For flac, I'd suggest using -t1 for decoding simply because flac is decompressing when installing unlike other codecs where they require multi threading to be fast as they are doing the opposite (compressing) during installation.

A small test on some audio files

Code:
Tested 39 files, 745,011,186 => 1,379,878,320 bytes. Ratio 53.99%
Testing time: cpu 1.08 sec/real 4.68 sec = 23%. Speed 295.10 mB/s
Using 12 threads, used 1.23 GB ram

Code:
Tested 39 files, 745,011,186 => 1,379,878,320 bytes. Ratio 53.99%
Testing time: cpu 0.97 sec/real 10.18 sec = 10%. Speed 135.58 mB/s
Using 1 thread, used 185 MB ram.

The single threaded speed is reasonable while using 12x number of threads only gave 2.2x speed benefits while using nearly 7x memory. Obviously due to IO bottleneck show that it's better to just use 1 thread.
Reply With Quote
The Following User Says Thank You to Razor12911 For This Useful Post:
shazzla (06-09-2023)