Skip to content

Conversation

ivmarkov
Copy link
Contributor

As much as I love Iterator monadic comprehensions (flat_map and friends), the IM path expansion logic in node.rs - which was using those - was resulting in huge iterators w.r.t. memory.

The rewrite of the path expansion logic in node.rs to use an explicit PathExpander iterator with mutable state saves ~ 5K RAM.
While more risky, the mutable logic is covered with unit tests.

Net-net I don't think this change would increase the codebase size, because while PathExpander is more verbose - methods from endpoint.rs and cluster.rs got retired, as these are no longer necessary with the explicit PathExpander.

Copy link

semanticdiff-com bot commented Sep 25, 2024

Review changes with SemanticDiff.

Analyzed 5 of 5 files.

Overall, the semantic diff is 8% smaller than the GitHub diff.

Filename Status
✔️ rs-matter/src/interaction_model/core.rs 0.87% smaller
✔️ rs-matter/src/data_model/core.rs 78.46% smaller
✔️ rs-matter/src/data_model/objects/cluster.rs Analyzed
✔️ rs-matter/src/data_model/objects/endpoint.rs 0.47% smaller
✔️ rs-matter/src/data_model/objects/node.rs 7.49% smaller

@kedars kedars merged commit 1bcb7b7 into project-chip:main Sep 26, 2024
12 checks passed
@ivmarkov ivmarkov deleted the path-expander3 branch November 28, 2024 12:27
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.

2 participants