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

Benchmark Array functions #75

Merged
merged 1 commit into from
Jun 24, 2024
Merged

Conversation

mashumafi
Copy link
Contributor

Adding benchmarks related to Array this was done as part of godotengine/godot#93276

Copy link
Contributor

@OverloadedOrama OverloadedOrama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally on my PC, everything seems to work as expected.

Results on my PC

{
"benchmarks": [
{
"category": "Core > Array",
"name": "Append Array 100",
"results": {
"time": 0.035
}
},
{
"category": "Core > Array",
"name": "Append Array 10 000",
"results": {
"time": 0.253
}
},
{
"category": "Core > Array",
"name": "Append Array 1 000 000",
"results": {
"time": 41.55
}
},
{
"category": "Core > Array",
"name": "Bsearch 100",
"results": {
"time": 0.044
}
},
{
"category": "Core > Array",
"name": "Bsearch 10 000",
"results": {
"time": 3.062
}
},
{
"category": "Core > Array",
"name": "Bsearch 1 000 000",
"results": {
"time": 410.3
}
},
{
"category": "Core > Array",
"name": "Fill 100",
"results": {
"time": 0.021
}
},
{
"category": "Core > Array",
"name": "Fill 10 000",
"results": {
"time": 0.049
}
},
{
"category": "Core > Array",
"name": "Fill 1 000 000",
"results": {
"time": 3.553
}
},
{
"category": "Core > Array",
"name": "Push Back 100",
"results": {
"time": 0.018
}
},
{
"category": "Core > Array",
"name": "Push Back 10 000",
"results": {
"time": 0.02
}
},
{
"category": "Core > Array",
"name": "Push Back 1 000 000",
"results": {
"time": 0.02
}
},
{
"category": "Core > Array",
"name": "Reverse 100",
"results": {
"time": 0.019
}
},
{
"category": "Core > Array",
"name": "Reverse 10 000",
"results": {
"time": 0.06
}
},
{
"category": "Core > Array",
"name": "Reverse 1 000 000",
"results": {
"time": 4.376
}
}
],
"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"
}
}

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, it works as expected.

However, these benchmarks run too fast (most of them take < 1 millisecond to complete), so they are bound to show high variance when running on the dedicated server every day. I suggest increasing the number of iterations so that each benchmark takes at least 50 milliseconds to complete (preferably 100-200 ms).

@mashumafi
Copy link
Contributor Author

mashumafi commented Jun 24, 2024

Tested locally, it works as expected.

However, these benchmarks run too fast (most of them take < 1 millisecond to complete), so they are bound to show high variance when running on the dedicated server every day. I suggest increasing the number of iterations so that each benchmark takes at least 50 milliseconds to complete (preferably 100-200 ms).

Made some changes to get benchmarks taking roughly 100-400 ms each. Check numbers below, I can try to get them closer to the 100-200 range if needed.


Running benchmark 1 of 4: core/array/append_array
Result: {"time":135.7}

Running benchmark 2 of 4: core/array/bsearch
Result: {"time":132.7}

Running benchmark 3 of 4: core/array/fill
Result: {"time":293.4}

Running benchmark 4 of 4: core/array/reverse
Result: {"time":413.8}

Made one more change to reduce numbers a bit more and have 1 million iterations like other tests have. New results:

Running benchmark 1 of 4: core/array/append_array
Result: {"time":221.1}

Running benchmark 2 of 4: core/array/bsearch
Result: {"time":161.6}

Running benchmark 3 of 4: core/array/fill
Result: {"time":77.13}

Running benchmark 4 of 4: core/array/reverse
Result: {"time":63.97}

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, it works as expected.

Thanks!

@Calinou Calinou merged commit d2a77c7 into godotengine:main Jun 24, 2024
@mashumafi mashumafi deleted the bench-array branch June 25, 2024 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants