Skip to content

Improve the time taken to validate and analyse large models#1397

Open
hsorby wants to merge 44 commits into
cellml:mainfrom
hsorby:issue1396
Open

Improve the time taken to validate and analyse large models#1397
hsorby wants to merge 44 commits into
cellml:mainfrom
hsorby:issue1396

Conversation

@hsorby

@hsorby hsorby commented May 19, 2026

Copy link
Copy Markdown
Contributor

To run the investigation tests set an environment variable BENCHMARKING_MODEL_ROOT to the root directory of the unzipped contents of the benchmarking files zip in the associated issue.

The longer tests are disabled with the DISABLED_ prefix on the test name, remove this prefix to run the test.

@hsorby hsorby marked this pull request as ready for review June 20, 2026 11:04
@hsorby hsorby requested a review from agarny June 20, 2026 11:04
agarny added 5 commits June 22, 2026 11:05
We don't take advantage of the optional `absolute` parameter. (Regarding `file.close()`, it's done automatically, so no actual need for it.)
- Converted `std::set<uintptr_t>` to `std::unordered_set<uintptr_t>`, resulting in O(1) average per operation instead of O(log n) per operation.
- Replaced double hash lookup with a single one.
`equivalentVariableGroups` wasn't being used as such. So, to replace it with `groupCount` means that we:
- eliminate n copies of std::unordered_set;
- remove all associated heap allocations from those sets and the vector itself; and
- save memory by not storing data that's never queried.
@hsorby hsorby changed the title Investigations into caching equivalent variables Improve the time take to validate and analyse large models Jun 22, 2026
@hsorby hsorby changed the title Improve the time take to validate and analyse large models Improve the time taken to validate and analyse large models Jun 22, 2026
agarny
agarny previously approved these changes Jun 22, 2026

@agarny agarny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good although I have sped up a few things here and there (see commit messages).

@agarny

agarny commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

To run the investigation tests set an environment variable BENCHMARKING_MODEL_ROOT to the root directory of the unzipped contents of the benchmarking files zip in the associated issue.

The longer tests are disabled with the DISABLED_ prefix on the test name, remove this prefix to run the test.

I can't see where BENCHMARKING_MODEL_ROOT and the DISABLED_ prefix are being used in this PR...?

@hsorby

hsorby commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

To run the investigation tests set an environment variable BENCHMARKING_MODEL_ROOT to the root directory of the unzipped contents of the benchmarking files zip in the associated issue.
The longer tests are disabled with the DISABLED_ prefix on the test name, remove this prefix to run the test.

I can't see where BENCHMARKING_MODEL_ROOT and the DISABLED_ prefix are being used in this PR...?

I have taken that bit out now, as this was only part of the investigation phase of this work.
It was there for people to be able to run the models given in the associated issue easily.

@agarny agarny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants