Timeline for Very slow frame rate in C++ N-body simulation using Barnes-Hutt and RK4
Current License: CC BY-SA 4.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 7, 2019 at 6:00 | history | tweeted | twitter.com/StackCodeReview/status/1082155008232226818 | ||
Jan 6, 2019 at 18:49 | vote | accept | Callum | ||
Jan 6, 2019 at 18:49 | comment | added | Callum | @user1118321 EPQ stands for extended project qualification, and yeah I should have been more clear that I meant 100,000 to 1,000,000 particles. | |
Jan 6, 2019 at 8:07 | answer | added | user1118321 | timeline score: 3 | |
Jan 6, 2019 at 7:04 | comment | added | Summer | @user1118321 ahh I did not fully understand the complexity. | |
Jan 6, 2019 at 7:02 | comment | added | user1118321 | @bruglesco There's a big difference between particle systems in a game where the particles in general don't interact with one another, and often don't interact with any other geometry, and in this case, which is an n-body simulation where the mass of each particle gravitationally attracts all other particles in the system. I don't know that game development techniques are enough for this situation. | |
Jan 6, 2019 at 6:55 | comment | added | user1118321 | What does "EPQ" stand for? Also, is "10^5/6" supposed to mean "10^5 or 10^6" (so 100,000 to 1,000,000 particles)? Just want to make sure I understand fully. | |
Jan 5, 2019 at 20:45 | comment | added | Callum | The rest of the code required for it to run is pages and pages so I wont dump it all on here. I have looked into object pools though which is promising and i will post a similar question on Game Development at some point. Thanks for all your advice :) | |
Jan 5, 2019 at 20:29 | comment | added | Cris Luengo |
Please include the cloud class and a main with some test data so we can run the code. Incomplete code snippets are hard to review, and make it impossible for us to help you improve the code.
|
|
Jan 5, 2019 at 19:39 | comment | added | Summer |
Would half a minute be normal when simulating this many particles? No. The target framers for most games is 60 FPS. I'm not sure how most particles systems achieve that though I suspect an object pool could be the answer. Be sure to head over to Game Development and see if they've seen this before. I bet they have.
|
|
Jan 5, 2019 at 19:09 | comment | added | greybeard |
(Welcome to Code Review!) While your question is on topic as far as you are ready for open-ended feedback, there are bound to be more promising places to ask Would half a minute be normal when simulating [10^5…6] particles?
|
|
Jan 5, 2019 at 16:33 | history | edited | 200_success | CC BY-SA 4.0 |
added 1 character in body; edited tags
|
Jan 5, 2019 at 15:15 | comment | added | Hulk | There's a lot of dynamic memory allocation going on here - might be worth profiling how much time that takes. If it's significant, you could try to avoid that (by reusing objects via some kind of pool and/or a custom allocator) | |
Jan 5, 2019 at 13:55 | review | First posts | |||
Jan 5, 2019 at 19:09 | |||||
Jan 5, 2019 at 13:50 | history | asked | Callum | CC BY-SA 4.0 |