On Fri, Feb 17, 2017 at 9:21 AM, Ammon Riley <[email protected]> wrote:
> On Thu, Feb 16, 2017 at 10:47 PM, Matthias Bodenbinder
> <[email protected]> wrote:
>>
>> Am 17.02.2017 um 06:57 schrieb Matthias Bodenbinder:
>> > Am 16.02.2017 um 23:27 schrieb Tobias Ellinghaus:
>> >
>> >> Neither module was changed between those two releases. Did you compile
>> >> both
>> >> versions yourself and are you sure that the compile flags are identical?
>> >>
>> >>> Good job! Thank you!
>> >>>
>> >>> Matthias
>> >>
>> >
>> > I compiled 2.2.3 myself and took 2.2.1 from debian testing .
>> >
>> > I will compile 2.2.1 myself and see.
>>
>> I checked it. This is indeed an issue with the self-compilation.
>>
>> If I pull the source from debian testing (apt-get source darktable) and
>> compile it by myself the benchmark is fast (15 s) compared to 22 s when I
>> use the debian testing binaries.
>>
>> This is somewhat shocking to me. Why is that?
>
> Pre-compiled binaries that you get from repositories have to be compiled for
> the
> lowest common denominator. As a result, they're generally compiled with the
> -march=generic/-mtune=generic flags. If you're compiling it yourself, then you
> can target the specific architecture of the machine you're on, which lets the
> compiler make better optimization choices.
>
> If you look at the cmake files for Darktable, the march and mtune settings
> have
> been split into their own file:
>
>
> https://raw.githubusercontent.com/darktable-org/darktable/master/cmake/march-mtune.cmake
>
> And indeed, it looks to see whether or not you're building a binary package
> (i.e. .deb or .rpm) to figure out what -march/-mtune setting to use.
>
>> And could I eventually see similar performance improvements with other apps?
>
> Maybe. It depends on the software, and the build configuration. Some
> software
> might have multiple versions of the processor-intensive routines using
> different
> levels of intrinsics (SSE2 vs. AVX2, etc), and use runtime dynamic dispatching
> to decide which routine to use. Compiling your own won't help here. Other
> software might be IO bound, for example, so the extra optimizations gained
> from
> compiling with -march=native are overshadowed by other factors. Compiling
> your
> own won't help here much, either. Many software packages don't take into
> consideration whether they're being built for a inclusion in a repository, so
> their build system doesn't make any effort at picking the correct
> -march/-mtune
> setting the way Darktable does, leaving it to the compiler default
> (-mtune=generic).
> Compiling your own may only help here if you go to the trouble of figuring out
> what it's doing, and forcing the -march/-mtune setting through command-line
> flags -- and then hope that the software doesn't fall into one of the
> earlier categories.
>
> Cheers,
> Ammon
___________________________________________________________________________
darktable developer mailing list
to unsubscribe send a mail to [email protected]