Basically, circles have auto_inc in their tables definitions, but ia_loop does not.
The consequence is that circles take a lot of time because the init_game_circles get called by each iteration of the benches, resulting in a big table with up to 1_000_000 rows when the setup was meant to be at most 10_000.
Then for the ia_loop the lack of auto_inc causes a unique constraint violation because the table is forbidden to grow.
Now:
In both, the database is initialized just once with the maximum amount of rows
Is removed group.measurement_time(Duration::from_secs(60 * 2)); that causes the bench to run longer than must
Removed the filtering in the ia_loop game loop based on timestamps, it causes the code to run differently between the integration test and benches.
Increase the size of ia_loop from [10, 100] to [500, 5_000] so criterion has something to measure:
# BEFORE
special/db_game/ia_loop/load=100
time: [0.0000 ps 0.0000 ps 0.0000 ps]
# AFTER
special/db_game/ia_loop/load=500
time: [386.62 ps 461.53 ps 640.54 ps]
API and ABI breaking changes
Nothing, but this change invalidates the numbers of previous benchmarks.
Expected complexity level and risk
1
Testing
Describe any testing you've done, and any testing you'd like your reviewers to do,
so that you're confident that all the changes work as expected!
[x] Runing a lot of benches with different parameters
Description of Changes
Corrections to how are benched
ia_loop
&circles
.Basically,
circles
haveauto_inc
in their tables definitions, butia_loop
does not.The consequence is that
circles
take a lot of time because theinit_game_circles
get called by each iteration of the benches, resulting in a big table with up to1_000_000
rows when the setup was meant to be at most10_000
.Then for the
ia_loop
the lack ofauto_inc
causes aunique constraint violation
because the table is forbidden to grow.Now:
group.measurement_time(Duration::from_secs(60 * 2));
that causes the bench to run longer than mustia_loop
game loop based ontimestamps
, it causes the code to run differently between the integration test and benches.ia_loop
from[10, 100]
to[500, 5_000]
so criterion has something to measure:API and ABI breaking changes
Nothing, but this change invalidates the numbers of previous benchmarks.
Expected complexity level and risk
1
Testing
Describe any testing you've done, and any testing you'd like your reviewers to do, so that you're confident that all the changes work as expected!