Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw04_finished, but why run with vs much slower? #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Pierce-qiang
Copy link

@Pierce-qiang Pierce-qiang commented Jan 10, 2022

Mingw32, cpu i7-9750H
//do nothing
Initial energy: -8.571526
Final energy: -8.511777
Time elapsed: 5386 ms

//just --fast-math -march=native -O3
Time elapsed: 3347 ms

//substitute sqrt with std::sqrt
Time elapsed: 2387 ms

//extract G * dt and eps * eps
Initial energy: -8.571528
Final energy: -8.511692
Time elapsed: 725 ms

//extract inv_d2
Time elapsed: 559 ms

// / 2 -> * 0.5 (almost nothing)
Time elapsed: 533 ms

//unroll 4 稳定慢了20ms(也可能是没效果) -划掉

//struct 对齐到8个float 反向优化200ms -划掉

//改array 没变化

//SOA
Time elapsed: 140 ms

未优化
vs debug 4221ms release 1130ms
优化后
vs debug 9200ms release 2700ms ??? 我辛辛苦苦半天优化怎么换到vs还慢了一倍多

@Pierce-qiang Pierce-qiang changed the title hw04_finished hw04_finished, but why run with vs much slower? Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant