Bugzilla – Attachment 695 Details for
Bug 1181
Performance Issue changing from 3.2.8 to 3.3beta1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
This bugzilla service is closed. All entries have been migrated to
https://gitlab.com/libeigen/eigen
Test code
main.cpp (text/plain), 1.07 KB, created by
neumann
on 2016-04-14 20:23:11 UTC
(
hide
)
Description:
Test code
Filename:
MIME Type:
Creator:
neumann
Created:
2016-04-14 20:23:11 UTC
Size:
1.07 KB
patch
obsolete
>#include <iostream> >#include <stdlib.h> >#include <chrono> >#include <Eigen/Core> > > >int main(int argc, char** argv) >{ > using namespace Eigen; > > Matrix3d tmp; > > Matrix3d tmp2; > tmp2 << 1, 2, 3, > 4, 5, 6, > 7, 8, 9; > > Vector3d yi; > yi << 2, 1, 9; > > > for (int i = 0; i < 10000000; ++i) //Just to get the CPU up to speed > { > yi << i + 1, -i + 2, i + 3; > tmp = yi*yi.transpose(); // <- This is slow > tmp *= 2; > } > tmp *= 2; > > std::chrono::time_point<std::chrono::high_resolution_clock, std::chrono::nanoseconds> det_init_begin, det_init_finished; > det_init_begin = std::chrono::high_resolution_clock::now(); > > for (int i = 0; i < 10000000; ++i) > { > yi << i + 1, -i + 2, i + 3; > //tmp = tmp2*yi.asDiagonal(); // <-This is fast > tmp = yi*yi.transpose(); // <- This is slow > tmp *= 2; > } > tmp *= 2; > > det_init_finished = std::chrono::high_resolution_clock::now(); > std::cout << "It took " << (det_init_finished - det_init_begin).count() / 1E7 << " ms to calc 10^7 values " << std::endl << std::endl; > > system("Pause"); > return EXIT_SUCCESS; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1181
: 695