Skip to content

chore: Factored out impl_property_eq_hash! as user-facing macro#927

Open
RobertJacobsonCDC wants to merge 1 commit into
mainfrom
RobertJacobsonCDC_911_impl_eq_hash_macro
Open

chore: Factored out impl_property_eq_hash! as user-facing macro#927
RobertJacobsonCDC wants to merge 1 commit into
mainfrom
RobertJacobsonCDC_911_impl_eq_hash_macro

Conversation

@RobertJacobsonCDC
Copy link
Copy Markdown
Collaborator

@RobertJacobsonCDC RobertJacobsonCDC commented May 27, 2026

This PR introduces new user-facing macros:

Macro Purpose
impl_property_eq! Implements PartialEq and Eq
impl_property_hash! Implements Hash
impl_property_eq_hash! Convenience macro that invokes both macros

I also added language to the Properties chapter of the Ixa Book explaining when to use them.

The point of these is, client code can now use them to generate implementations for these traits when they cannot be derived in the case they define the property type themselves instead of using define_*_property! macros.

These macros previously existed as "internal subcommands" of the define_property! macro, so from that point of view this isn't exactly new functionality. It's just that it's now intended to be exposed to the end user.

@github-actions
Copy link
Copy Markdown

Benchmark Results

Hyperfine

Command Mean [ms] Min [ms] Max [ms] Relative
large_sir::baseline 3.3 ± 0.0 3.2 3.4 1.00
large_sir::baseline_households 3.3 ± 0.0 3.2 3.4 1.00 ± 0.02
large_sir::entities 7.3 ± 0.1 7.1 7.6 2.22 ± 0.05
large_sir::households 7.0 ± 0.1 6.9 7.7 2.14 ± 0.05

Criterion

Regressions (slower)
Group Bench Param Change CI Lower CI Upper
sample_entity sample_entity_single_property_unindexed 1000 29.742% 28.271% 31.154%
indexing query_people_count_single_indexed_property_entities 14.396% 12.738% 16.276%
sample_entity sample_entity_single_property_unindexed 10000 12.502% 9.267% 16.006%
large_dataset bench_query_population_derived_property_entities 5.360% 4.498% 6.452%
sample_entity sample_entity_whole_population 1000 4.891% 4.256% 5.471%
sample_entity sample_entity_single_property_indexed 10000 3.539% 2.569% 4.666%
sample_entity sample_entity_whole_population 10000 3.246% 2.669% 3.808%
sample_entity sample_entity_whole_population 100000 3.213% 1.740% 4.607%
large_dataset bench_query_population_multi_indexed_entities 2.875% 2.429% 3.230%
indexing query_people_multiple_individually_indexed_properties_entities 2.349% 1.512% 3.234%
sampling sampling_single_unindexed_concrete_plus_derived_entities 2.087% 1.871% 2.350%
sampling count_and_sampling_single_unindexed_concrete_plus_derived_entiti 1.924% 1.648% 2.220%
counts reindex_after_adding_more_entities 1.613% 1.016% 2.307%
Improvements (faster)
Group Bench Param Change CI Lower CI Upper
sampling sampling_multiple_unindexed_entities -14.215% -15.077% -13.225%
examples example-births-deaths -8.392% -9.433% -7.304%
sampling sampling_single_unindexed_entities -8.053% -10.395% -5.601%
sampling count_and_sampling_single_known_length_entities -4.556% -5.602% -3.489%
counts multi_property_indexed_entities -3.740% -4.024% -3.462%
sampling sampling_single_known_length_entities -3.009% -4.485% -1.907%
sampling sampling_multiple_l_reservoir_entities -1.721% -2.022% -1.489%
Unchanged / inconclusive (CI crosses 0%)
Group Bench Param Change CI Lower CI Upper
large_dataset bench_filter_indexed_entity 1.861% -6.865% 11.318%
sampling sampling_single_l_reservoir_entities 1.321% 0.677% 2.031%
indexing with_query_results_multiple_individually_indexed_properties_enti 1.293% 0.725% 1.739%
indexing query_people_single_indexed_property_entities 1.245% 0.654% 1.910%
large_dataset bench_query_population_multi_unindexed_entities -1.122% -1.644% -0.718%
indexing query_people_count_multiple_individually_indexed_properties_enti 0.934% 0.091% 1.821%
examples example-basic-infection -0.776% -1.483% -0.078%
counts multi_property_unindexed_entities 0.686% 0.474% 0.896%
counts single_property_indexed_entities 0.508% -0.448% 1.416%
sample_entity sample_entity_single_property_indexed 1000 -0.447% -0.791% 0.113%
sample_entity sample_entity_multi_property_indexed 10000 0.438% 0.176% 0.690%
large_dataset bench_match_entity -0.324% -1.010% 0.294%
sample_entity sample_entity_single_property_unindexed 100000 -0.321% -0.685% 0.155%
large_dataset bench_query_population_property_entities 0.301% -0.397% 1.276%
large_dataset bench_filter_unindexed_entity 0.283% -3.296% 3.661%
large_dataset bench_query_population_indexed_property_entities -0.276% -1.561% 0.701%
sample_entity sample_entity_multi_property_indexed 1000 0.273% -0.020% 0.692%
indexing query_people_indexed_multi-property_entities 0.252% -0.055% 0.586%
counts index_after_adding_entities 0.241% -0.145% 0.519%
counts single_property_unindexed_entities -0.232% -0.955% 0.354%
indexing with_query_results_single_indexed_property_entities -0.223% -0.765% 0.311%
algorithm_benches algorithm_sampling_single_rand_reservoir -0.174% -0.653% 0.230%
sample_entity sample_entity_single_property_indexed 100000 -0.164% -0.599% 0.188%
algorithm_benches algorithm_sampling_multiple_l_reservoir -0.161% -0.605% 0.240%
algorithm_benches algorithm_sampling_single_l_reservoir -0.131% -0.479% 0.244%
indexing query_people_count_indexed_multi-property_entities 0.119% -0.285% 0.418%
algorithm_benches algorithm_sampling_single_known_length -0.118% -0.627% 0.395%
counts concrete_plus_derived_unindexed_entities 0.092% -0.341% 0.718%
sample_entity sample_entity_multi_property_indexed 100000 -0.075% -0.361% 0.221%
sampling sampling_multiple_known_length_entities -0.061% -0.295% 0.165%
algorithm_benches algorithm_sampling_multiple_known_length 0.026% -0.250% 0.285%
indexing with_query_results_indexed_multi-property_entities 0.013% -0.565% 0.590%
Not Compared (no baseline yet)
Group Bench Reason
(none)

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

Split out generating Eq & Hash for property type into a separate user-facing macro

2 participants