Re: [eigen] Low performance in DEBUG mode |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Low performance in DEBUG mode
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Mon, 25 Oct 2010 08:34:00 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=YnTQxUeQMkExukxzbxgFJ80Z5usHjOkqrqJhMaoAFBY=; b=FdBKv5jkm4pGAVu8Napx+VWRINZaR3gOHe1GVgV1pVtbTFL3cRV1yn1OwT5sPQ+R4p 7BDeYgod/qnuotzq+FkqBfuEYmInsqdAiUbaj2ilZ7JnmQxrkAK06si3xxYyY7Fi4kK7 aEVrx9NqILQaGF1DoUwfG/Z7Ddgn8j6BkH3w0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=e5VUjA/+xiQ1w7T5DhClUhlTtvXyqKhrmd34zMt3vwbx2rgJX+BjEwLdf3eOB2pGg4 I8NCqiz8HgCwUt3JJmZIiBg9zgIatCffrK7w1Ls3d3q2SyBKl9vClUXPdIWhIQP7IDj6 eRm4I2UPmVJPz6TiQd8VFftQKhs6X6LgXMI8Q=
2010/10/25 Benjamin Schindler <bschindler@xxxxxxxxxxx>:
> I too have the problem of slow debug code, but the reason there is that
> I have to use debug builds because stepping through code is hard on
> RelWithDebInfo code. With Debug code, obviously eigen is extremely slow.
>
> Is there any way to compile Eigen code with optimizations and the rest
> with debug?
No; but I think that GCC 4.4 introduced per-function optimization
flags, feel free to play with it; but obviously Eigen spends its time
in lots and lots of small functions so putting this flag on the right
functions will require a good amount of work. If it weren't too
intrusive I'd accept a patch, i think.
A much simpler approach is to compile those files in your project that
use Eigen with optimization. You could organize your project so that
Eigen-heavy code is isolated in separate files.
This would be very helpful as I frequently have to wait 5-10
> minutes for calculations until a breakpoint is hit when it takes about
> 10 seconds in release code.
> I checked with gcc but didn't find a meaningful way (except by modifying
> Eigen code itself...), but may be somebody has more experience? With
> non-template libraries it's so easy to use release code, so why not
> doing the same for template libraries is beyond me...
because a template library gets compiled directly into your app, so
the equivalent in this case is to isolate the resulting code in
separate files.
Benoit
>
> Cheers
> Benjamin
>
> On 10/25/2010 12:50 PM, Mathias Goldau wrote:
>> Hi,
>>
>> today I encountered a really strange thing: I compiled my unittest which need
>> in Release mode just about 3 sec, in Debug mode. It uses just some matrix
>> vector multiplication and the inverse computation. However in Debug mode it
>> needs about 3:32 minutes!!
>> A colleague of mine told me this could have to do with expression templates,
>> and as I've seen in the "We need more Gaels"-thread that Eigen uses a lot of
>> expression templates, I want to ask: Is this assumption true?, is there a way
>> around to compile my unit tests also in debug mode, but with a bit more
>> performance in the end?
>> Even setting our cmake build type to: RelWithDebugInfo resulting effective in
>> those CXX flags: "-g -DDEBUG -O2" shows no improvement. I assume this depends
>> on the "-DDEBUG", am I right?
>>
>> best regards
>> Mathias
>>
>
>
>
>