Standard: Code efficiency #166

Open
opened 2020-08-20 06:09:26 +02:00 by Kreyren · 1 comment
Kreyren commented 2020-08-20 06:09:26 +02:00 (Migrated from github.com)

All software should have a benchmarks (i.e. using criterion https://github.com/bheisler/criterion.rs adapted to capture a regression caused by code changes that can be referenced agains a previous tests on the same system with calculations that account for a system noise.

Real life example of the issue:

https://github.com/Kreyren/rustlang-fibonacci is average fibonacci sequence that fails to process fib(43) due to the excessive amount of resources needed to process such runtime that doesn't fit into a realistic system resource budged.

Compared to https://github.com/Kreyren/rustlang-fibonacci/tree/kreyren/case-study-performance-2 which hits the system limit in 11.43ns making it 371.2% more efficient and allows for the expected runtime.

Use https://gitpod.io/#https://github.com/Kreyren/rustlang-fibonacci/tree/kreyren/case-study-performance-2 with cargo bench to verify the results. Note that gitpod has 14~30% of system noise where the software in question is using criterion with 1000 tests made average to mitigate for this system noise to provide somewhat accurate results (seems to be accurate within 5 micro seconds)

<!-- Please keep your request as short as possible, the longer the request the longer it's going to take for us to process it --> All software should have a benchmarks (i.e. using criterion <https://github.com/bheisler/criterion.rs> adapted to capture a regression caused by code changes that can be referenced agains a previous tests on the same system with calculations that account for a system noise. Real life example of the issue: https://github.com/Kreyren/rustlang-fibonacci is average fibonacci sequence that fails to process `fib(43)` due to the excessive amount of resources needed to process such runtime that doesn't fit into a realistic system resource budged. Compared to https://github.com/Kreyren/rustlang-fibonacci/tree/kreyren/case-study-performance-2 which hits the system limit in 11.43ns making it 371.2% more efficient and allows for the expected runtime. Use https://gitpod.io/#https://github.com/Kreyren/rustlang-fibonacci/tree/kreyren/case-study-performance-2 with `cargo bench` to verify the results. Note that gitpod has 14~30% of system noise where the software in question is using criterion with 1000 tests made average to mitigate for this system noise to provide somewhat accurate results (seems to be accurate within 5 micro seconds)
issue-label-bot[bot] commented 2020-08-20 06:09:29 +02:00 (Migrated from github.com)

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.87. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Issue-Label Bot is automatically applying the label `feature_request` to this issue, with a confidence of 0.87. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback! Links: [app homepage](https://github.com/marketplace/issue-label-bot), [dashboard](https://mlbot.net/data/RXT0112/Zernit) and [code](https://github.com/hamelsmu/MLapp) for this bot.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kreyren/Zernit#166
No description provided.