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:
I am quite puzzled as to why drawing the elements once sometimes results in more CPU & GPU time, than re-rendering them every frame. I added benchmarks for 10000 and 20000 elements in case 5000 is too low and it's being affected by an error margin, but I still get weird results for these benchmarks as well. Not sure if I'm doing something wrong, the logic seems fine to me, but let me know if I should keep or remove the benchmarks for 10000 & 20000 elements.
Results on my PC
{
"benchmarks": [
{
"category": "Rendering > Canvas Item",
"name": "Draw 10 000 Shapes Every Frame",
"results": {
"render_cpu": 2.542,
"render_gpu": 4.311,
"time": 0.029
}
},
{
"category": "Rendering > Canvas Item",
"name": "Draw 10 000 Shapes Once",
"results": {
"render_cpu": 2.563,
"render_gpu": 4.435,
"time": 0.035
}
},
{
"category": "Rendering > Canvas Item",
"name": "Draw 20 000 Shapes Every Frame",
"results": {
"render_cpu": 5.243,
"render_gpu": 8.6,
"time": 0.023
}
},
{
"category": "Rendering > Canvas Item",
"name": "Draw 20 000 Shapes Once",
"results": {
"render_cpu": 5.02,
"render_gpu": 8.739,
"time": 0.049
}
},
{
"category": "Rendering > Canvas Item",
"name": "Draw 5000 Shapes Every Frame",
"results": {
"render_cpu": 1.216,
"render_gpu": 2.162,
"time": 0.041
}
},
{
"category": "Rendering > Canvas Item",
"name": "Draw 5000 Shapes Once",
"results": {
"render_cpu": 1.336,
"render_gpu": 2.21,
"time": 0.1
}
}
],
"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"
}
}