Skip to content

Comments

docs: Pre-schedule all infections#788

Draft
swo wants to merge 1 commit intoswo_examplefrom
swo_example_foi
Draft

docs: Pre-schedule all infections#788
swo wants to merge 1 commit intoswo_examplefrom
swo_example_foi

Conversation

@swo
Copy link
Contributor

@swo swo commented Feb 19, 2026

The disease_model example is explained in the text as each person having an independent time to infection. So I think it's actually easier to understand if you just pre-schedule all the infections.

I see the pros of this change as

  1. the new code better follows the explanation of the model
  2. you only attempt infection once for each person
  3. the new code sets up a paradigm where, upon infection, you pre-schedule an infector's infections and later figure out which ones happen

I see the pros of the status quo are:

  1. the new code is more complicated: it involves a query, a vector, and two turbofishes (at least, the way I did it does-- I'm a rust & ixa noob and there might be an easier way)
  2. the existing code sets up a paradigm where, upon infection, you schedule the infections one at a time.

@swo swo changed the title Pre-schedule all infections docs: Pre-schedule all infections Feb 19, 2026
@github-actions
Copy link

Benchmark Results

Hyperfine

Command Mean [ms] Min [ms] Max [ms] Relative
large_sir::baseline 2.3 ± 0.0 2.2 2.5 1.00
large_sir::entities 10.1 ± 0.9 9.8 16.4 4.40 ± 0.41

Criterion

Regressions:
  Group                                    Bench                                              Change  CI Lower  CI Upper
  ---------------------------------------  ------------------------------------------------  -------  --------  --------
  sampling                                 sampling_multiple_known_length_entities            0.870%    0.572%    1.283%
  sample_entity_single_property_indexed    10000                                              0.901%    0.530%    1.394%
  sample_entity_single_property_indexed    100000                                             1.342%    0.851%    1.687%
  large_dataset                            bench_query_population_indexed_property_entities   1.905%    1.232%    2.581%
  large_dataset                            bench_query_population_multi_unindexed_entities    0.298%    0.008%    0.704%
  sample_entity_whole_population           100000                                             3.786%    3.216%    4.320%
  sample_entity_multi_property_indexed     10000                                              0.486%    0.020%    0.896%
  sample_entity_multi_property_indexed     100000                                             0.475%    0.228%    0.846%

Improvements:
  Group                                    Bench                                              Change  CI Lower  CI Upper
  ---------------------------------------  ------------------------------------------------  -------  --------  --------
  sampling                                 sampling_single_unindexed_entities                -0.323%   -0.392%   -0.255%
  sampling                                 sampling_multiple_unindexed_entities              -0.140%   -0.221%   -0.082%
  sampling                                 sampling_multiple_l_reservoir_entities            -1.597%   -1.658%   -1.540%
  sampling                                 sampling_single_l_reservoir_entities              -2.452%   -2.501%   -2.404%
  sample_entity_single_property_unindexed  100000                                            -0.428%   -0.761%   -0.140%
  large_dataset                            bench_query_population_derived_property_entities  -2.050%   -2.396%   -1.692%
  sample_entity_whole_population           10000                                             -1.057%   -1.435%   -0.532%
  sample_entity_whole_population           1000                                              -7.395%   -7.571%   -7.248%

Unchanged:
  Group                                    Bench                                              Change  CI Lower  CI Upper
  ---------------------------------------  ------------------------------------------------  -------  --------  --------
  sampling                                 sampling_single_known_length_entities              0.551%   -0.097%    1.006%
  sample_entity_single_property_indexed    1000                                               0.295%   -0.162%    0.586%
  sample_entity_single_property_unindexed  10000                                             -0.398%   -2.031%    1.372%
  sample_entity_single_property_unindexed  1000                                               0.441%   -0.408%    1.320%
  large_dataset                            bench_query_population_property_entities          -0.002%   -0.535%    0.477%
  large_dataset                            bench_filter_indexed_entity                        4.878%   -4.998%   14.973%
  large_dataset                            bench_query_population_multi_indexed_entities      0.184%   -0.455%    0.891%
  large_dataset                            bench_match_entity                                 0.232%   -0.331%    0.597%
  large_dataset                            bench_filter_unindexed_entity                      0.659%   -2.019%    3.544%
  sample_entity_multi_property_indexed     1000                                               0.187%   -0.361%    0.650%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant