Debug mode is unusably slow
Submitted by Nathaniel Bogan
Assigned to Nobody
Link to original bugzilla bug (#1673)
Version: 3.3 (current stable)
Operating system: Windows
Description
Created attachment 920
Source for slow Debug
We have been hoping to embrace Eigen for all of our linear algebra needs, but we have found that the debug mode performance is so slow as to be nearly equivalent to not having a debug mode. As is, the library is not usable for our purposes.
The attached piece of code and batch file demonstrate one representative scenario. On a slightly old machine, my output is as follows:
$ ./EigenTestDebug.exe
Eigen resize msec: 3549
Eigen init msec: 11082
Simple dot msec: 386
Eigen dot msec: 20267
$ ./EigenTestRelease.exe
Eigen resize msec: 23
Eigen init msec: 339
Simple dot msec: 38
Eigen dot msec: 55
An operation that takes 55 msec in release mode takes over 20 seconds in debug mode, or about 370x slower. We have many tool that run in the 500ms-1sec range, so this sort of factor results in taking many minutes in Debug mode, and thus is not useful, forcing old-school print statements instead.
The "boneheaded" implementation that I provide is about 7x slower in debug mode, which is within expectations and quite usable.
Attachment 920, "Source for slow Debug":
EigenTest.cpp