Skip to content

docs: Random network example#980

Open
swo wants to merge 11 commits into
mainfrom
swo_random_network
Open

docs: Random network example#980
swo wants to merge 11 commits into
mainfrom
swo_random_network

Conversation

@swo

@swo swo commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Minimal example of a randomly-generated network. Shows how to use an external graph-generating package to build connection networks.

Some open questions I think this PR poses:

  1. Does this example belong here? How many examples do we want in this repo? One solution I could see, is having ~3 very well-curated examples here in this repo, and then another, more free-for-all ixa-examples repo.
  2. Do we want to allow users to access rngs defined by define_rng!?. Right now, get_rng() is private, so users can't directly access the defined rngs or their states. In this example, I need to call an external-to-ixa function to generate the graph, and I might have wanted to use the rng state to seed the generation of that graph, rather than passing around a seed as if it were a separate parameter.

@swo swo self-assigned this Jun 25, 2026
github-actions Bot added a commit that referenced this pull request Jun 25, 2026
@CDCgov CDCgov deleted a comment from github-actions Bot Jun 25, 2026
github-actions Bot added a commit that referenced this pull request Jun 25, 2026
github-actions Bot added a commit that referenced this pull request Jun 25, 2026
@CDCgov CDCgov deleted a comment from github-actions Bot Jun 26, 2026
@CDCgov CDCgov deleted a comment from github-actions Bot Jun 26, 2026
github-actions Bot added a commit that referenced this pull request Jun 26, 2026
github-actions Bot added a commit that referenced this pull request Jun 26, 2026
@CDCgov CDCgov deleted a comment from github-actions Bot Jun 26, 2026
@CDCgov CDCgov deleted a comment from github-actions Bot Jun 26, 2026
@swo swo requested a review from RobertJacobsonCDC June 26, 2026 19:01
@swo swo marked this pull request as ready for review June 26, 2026 19:02
@github-actions

Copy link
Copy Markdown

Benchmark Results

Hyperfine

Command Mean [ms] Min [ms] Max [ms] Relative
large_sir::baseline 3.6 ± 0.2 3.4 4.1 1.04 ± 0.06
large_sir::baseline_households 3.5 ± 0.1 3.4 4.1 1.00
large_sir::entities 7.8 ± 0.5 7.4 9.6 2.24 ± 0.17
large_sir::households 7.4 ± 0.4 7.2 10.0 2.14 ± 0.13

Criterion

Regressions (slower)
Group Bench Param Change CI Lower CI Upper
large_dataset bench_match_entity 33.446% 32.666% 34.208%
sample_entity sample_entity_multi_property_indexed 10000 6.139% 5.579% 6.713%
sample_entity sample_entity_multi_property_indexed 1000 5.729% 5.109% 6.335%
sample_entity sample_entity_multi_property_indexed 100000 5.119% 3.770% 6.179%
sampling count_and_sampling_single_known_length_entities 4.916% 4.571% 5.266%
examples example-births-deaths 3.016% 2.758% 3.272%
sampling sampling_single_l_reservoir_entities 1.954% 1.099% 2.683%
counts index_after_adding_entities 1.464% 1.278% 1.649%
sampling sampling_multiple_l_reservoir_entities 1.411% 1.030% 1.773%
Improvements (faster)
Group Bench Param Change CI Lower CI Upper
large_dataset bench_query_population_multi_indexed_entities -29.488% -30.194% -28.738%
sample_entity sample_entity_single_property_unindexed 10000 -20.833% -23.217% -18.348%
sample_entity sample_entity_single_property_indexed 100000 -13.620% -14.193% -13.004%
sample_entity sample_entity_single_property_indexed 10000 -13.018% -13.697% -12.218%
sample_entity sample_entity_single_property_unindexed 1000 -8.331% -9.528% -7.182%
indexing query_people_indexed_multi-property_entities -6.167% -6.537% -5.866%
large_dataset bench_filter_indexed_entity -5.751% -7.781% -3.665%
examples example-basic-infection -3.401% -3.769% -3.068%
large_dataset bench_query_population_indexed_property_entities -3.001% -4.860% -1.136%
counts multi_property_indexed_entities -2.186% -2.901% -1.434%
indexing with_query_results_multiple_individually_indexed_properties_enti -2.098% -2.852% -1.524%
Unchanged / inconclusive (CI crosses 0%)
Group Bench Param Change CI Lower CI Upper
large_dataset bench_query_population_property_entities 1.743% 0.416% 3.461%
sample_entity sample_entity_whole_population 10000 -1.494% -3.165% -0.192%
sampling sampling_multiple_known_length_entities 1.034% 0.735% 1.347%
large_dataset bench_query_population_derived_property_entities 0.949% 0.351% 1.514%
sampling sampling_single_known_length_entities -0.938% -1.550% -0.401%
large_dataset bench_query_population_multi_unindexed_entities -0.895% -1.235% -0.387%
large_dataset bench_filter_unindexed_entity 0.888% -2.405% 4.177%
indexing with_query_results_indexed_multi-property_entities -0.811% -1.506% -0.081%
counts multi_property_unindexed_entities -0.691% -1.228% -0.253%
sample_entity sample_entity_whole_population 100000 -0.645% -1.530% 0.081%
indexing query_people_count_indexed_multi-property_entities 0.630% 0.206% 1.055%
counts reindex_after_adding_more_entities 0.502% 0.360% 0.626%
indexing query_people_count_single_indexed_property_entities 0.411% -0.211% 0.959%
sampling count_and_sampling_single_unindexed_concrete_plus_derived_entiti -0.383% -0.531% -0.230%
indexing query_people_count_multiple_individually_indexed_properties_enti 0.358% 0.232% 0.489%
sampling sampling_single_unindexed_concrete_plus_derived_entities -0.355% -0.803% 0.077%
algorithm_benches algorithm_sampling_single_l_reservoir -0.314% -0.715% 0.175%
algorithm_benches algorithm_sampling_single_known_length 0.312% -3.417% 4.348%
sampling sampling_multiple_unindexed_entities 0.246% 0.131% 0.323%
counts single_property_indexed_entities 0.194% -0.433% 0.783%
indexing query_people_multiple_individually_indexed_properties_entities -0.185% -0.638% 0.085%
indexing query_people_single_indexed_property_entities 0.149% -0.002% 0.295%
algorithm_benches algorithm_sampling_multiple_l_reservoir 0.124% -0.353% 0.757%
algorithm_benches algorithm_sampling_single_rand_reservoir 0.066% -0.202% 0.323%
indexing with_query_results_single_indexed_property_entities 0.059% -0.271% 0.361%
algorithm_benches algorithm_sampling_multiple_known_length 0.059% -0.325% 0.481%
sample_entity sample_entity_single_property_unindexed 100000 0.057% -0.420% 0.541%
counts concrete_plus_derived_unindexed_entities 0.038% -0.260% 0.311%
sample_entity sample_entity_whole_population 1000 0.038% -1.268% 1.199%
sampling sampling_single_unindexed_entities 0.016% -0.151% 0.146%
sample_entity sample_entity_single_property_indexed 1000 -0.012% -2.407% 2.318%
counts single_property_unindexed_entities 0.001% -0.526% 0.522%
Not Compared (no baseline yet)
Group Bench Reason
(none)

github-actions Bot added a commit that referenced this pull request Jun 26, 2026
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.

3 participants