Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the following benchmarks from #36:
CPU🟥 Rigid Bodies : Throw 2000 shapes next to each other in a pit, let them solve and stack, measure performance for 20 seconds
was already implemented in rigid_body_2d.gd.For the CharacterBody2D benchmark, I used the tileset from the Godot 2D physics platformer demo and made a new scene using it. I'm not sure if it's "complex" enough, so let me know if I should make changes.
For the Raycast2D benchmark, I used
PhysicsServer2D
instead of creating a scene, as using a scene would use the 5 second timer, and since this is an algorithm, I figured we should use pure code instead. A downside of this approach is that the scene (which has 2000 shapes), is being created via code and thus is being included in the resulting time. Should I create a pre-made scene instead of creating a new one on the fly via code? I'm not sure how I can disable the 5 second timer if I do that though.As I mentioned here #71 (comment), the timer is hard-coded to 5 seconds, and thus I can't change the time for individual benchmarks to the 10 and 20 seconds that are requested. If this is desired, I could try and refactor the code to allow the amount of seconds to get changed by individual benchmarks in another PR, and I can later update these benchmarks.
Results on my PC
{
"benchmarks": [
{
"category": "Physics > Area 2d",
"name": "1000 Area 2d",
"results": {
"idle": 107.9,
"physics": 18.84,
"time": 0.078
}
},
{
"category": "Physics > Character Body 2d",
"name": "1000 Character Bodies 2d",
"results": {
"idle": 62.01,
"physics": 33.07,
"time": 0.053
}
},
{
"category": "Physics > Raycast 2d",
"name": "10 000 Raycast 2d",
"results": {
"time": 81.67
}
}
],
"engine": {
"version": "v4.3.beta1.official",
"version_hash": "a4f2ea91a1bd18f70a43ff4c1377db49b56bc3f0"
},
"system": {
"cpu_architecture": "x86_64",
"cpu_count": 12,
"cpu_name": "AMD Ryzen 5 1600 Six-Core Processor",
"os": "Linux"
}
}