[x264-devel] Performance difference between windows and linux

Henrik Gramner henrik at gramner.com
Tue Feb 7 11:45:08 CET 2017


On Tue, Feb 7, 2017 at 5:45 AM, Pradeep Ramachandran
<pradeeprama at gmail.com> wrote:
> I'm copying my files to a RAM disk that I create using a tool like lmdisk
> and reading files from there; shouldn't that be sufficient?

Depends on how the OS kernel handles it. If it's clever enough to
essentially treat the RAM disk directly as a page cache that would
avoid unnecessary memory copying, but if it treats the RAM disk as
just a fast disk and still caches files then the file will likely be
read from memory, written back to different location in memory (the
page cache), and then read from there, which is inefficient for
obvious reasons. I'm not a kernel dev and I have no idea what either
system does.

The raw input modules in x264 CLI uses mmap()/MapViewOfFile() if
possible which essentially maps a portion of the OS page cache
directly into it's address space.

It's probably a good idea to to test both cases of the input being
cached or not.

To test cached input it should be enough to read through the entire
input file a few times first as long as the file is reasonably small.
To test uncached input the OS page cache needs to be cleared before
each run, this can be done as following:

Linux:
sync && echo 1 | sudo tee /proc/sys/vm/drop_caches

Windows:
Run https://technet.microsoft.com/en-us/sysinternals/rammap.aspx and
use Empty -> Empty Standby List.


More information about the x264-devel mailing list