r/rust_p 12d ago

Physics Engine That Only Computes What Moves: Achieving 99.9% Sleep Efficiency and 900+ TPS.

Enable HLS to view with audio, or disable this notification

I TESTED PERF. OF MY ENGINE AFTER IMPLEMENTING FL_PORTOCOL (MY MEMORY ARCHITECTURE)

DETAILED POST: https://www.reddit.com/r/rust_p/s/rqfpM1PNPu

7 Upvotes

8 comments sorted by

4

u/thekwoka 12d ago

Is the idea it just keeps track of what moved last time so it only looks at if its movement causes another thing to move this time?

1

u/IamRustyRust 12d ago

If what you are saying were true, the complexity of the algorithm would be O(N) instead of O(1). I am actually doing this in O(1) complexity. According to your logic, I would have to target objects that haven't even moved, which the CPU shouldn't need to tackle at all. I want to target strictly only those that actually require solving. For a detailed explanation, check the detailed version of this post. I have graphs there where I explained everything:https://www.reddit.com/r/rust_p/s/rqfpM1PNPu

16

u/thekwoka 11d ago

the complexity of the algorithm would be O(N)

No...well, N being items that moved, not total items.

I am actually doing this in O(1) complexity

You are definitely not...as your own charts show...

1

u/IamRustyRust 11d ago edited 11d ago

I think you're mixing up the question you originally asked with the complexity of processing the bodies after they've been identified. Your original question was specifically about how the system ‘keeps track’ so it can know what to look at next. That's the part I'm saying is O(1), I'm not scanning N bodies to find the target. The target is already directly addressable. Once I have that target, obviously the amount of solver work depends on how many bodies are actually active.

Your original question was: "Is the idea it just *keeps track of what moved last time** so it only looks at if its movement causes another thing to move this time?"*

6

u/thekwoka 11d ago

Okay, how does that answer the question?

How is it directly addressable if you aren't...keeping track of it?

1

u/[deleted] 11d ago

[removed] — view removed comment

2

u/SubjectRound6597 10d ago

Maybe turn off the desktop audio in your obs settings, or whatever you are recording with.