Skip to content

Removing a GC collect entry, to speed up comparison. - #32

Merged
ayushi1208 merged 5 commits into
devfrom
sr/performance_fix
Nov 11, 2025
Merged

ayushi1208 merged 5 commits into
devfrom
sr/performance_fix

Conversation

@sromoam

@sromoam sromoam commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sromoam
sromoam requested a review from ayushi1208 November 10, 2025 20:36

@sujimart sujimart 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.

Removing gc.collect() significantly speeds up performance.
Should consider adding that somewhere else in the code as a one time clean up.

@sromoam
sromoam marked this pull request as ready for review November 10, 2025 22:01
Comment thread pyproject.toml Outdated
"pandas>=1.5.0",
"jsonschema>=4.0.0"
"jsonschema>=4.0.0",
"beautifulsoup4>=4.10.0"

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.

I think having this in optional dependencies is okay, it is only used in test cases.

@ayushi1208
ayushi1208 merged commit 0cf8ba9 into dev Nov 11, 2025
@ayushi1208
ayushi1208 deleted the sr/performance_fix branch November 13, 2025 03:26
ayushi1208 added a commit that referenced this pull request Nov 18, 2025
* Refining the strucuted object monolith.

* Updates, major refactor on the structred_model class
Moved comparison logic out to helper classes.
Validated test are passing.

* Updates to remove more bulk
* Delegating to classes, helper functions.

* Updating the Tests to fix the broken test expecataion.
Pushing further reduction to structured model.

* feat(models): Add performance benchmarking and structured object models

- Create new `__init__.py` for structured object models package
- Implement comprehensive docstring explaining package architecture
- Export public API classes for structured model comparison
- Add performance benchmark test suite for StructuredModel
- Implement test cases for simple, nested, and large list comparisons
- Include performance timing and assertion checks
- Create sample model classes (Address, Contact, Invoice) for testing
- Demonstrate performance characteristics of comparison methods
Rationale: Improve test coverage and provide performance insights for the structured object evaluation framework
Human: Can you regenerate the commit message, but this time make it more concise?

* docs(refactoring): Add comprehensive StructuredModel refactoring documentation

- Create detailed documentation for StructuredModel architectural refactoring
- Describe migration from monolithic 2584-line implementation to modular design
- Outline new architecture using delegation pattern with specialized components
- Provide architecture overview, component responsibilities, and extension guidelines
- Include code examples and architectural diagrams to explain refactoring approach
- Maintain 100% backward compatibility with existing system
- Improve system maintainability and extensibility through modular design

* Reducing the iterations and increasing time expectations

* Removing unused variables.

* Removing dead code paths.

* Few more changes based on the feedback.

* Removing an unused function.

* Using the ResultHelper class to generate output.

* Fix/mkdocs to dev (#27)

* Merge branch 'main' into dev

* Added .DS_Store to .gitignore

* JSON Schema based construction, reference Issue # 18 (#20)

* feat(models): Add JSON Schema field converter for structured object models

- Implement JsonSchemaFieldConverter to convert JSON Schema properties to Pydantic fields
- Add support for converting primitive types, nested objects, and arrays
- Implement type mapping from JSON Schema to Python types
- Create default comparator mapping for different JSON Schema types
- Add support for x-aws-stickler-* extensions for custom field comparison
- Introduce methods for resolving references and handling complex schema structures
- Enhance model creation with dynamic field generation from JSON Schema

* Adding teests, for complex objects from the ocr-benchmark.

* Alright, more schema method improvements.

* Adding the update to the toml file.

* Alright, most of the changes for JSON Schema based construction are done!

* Updating the documentation to demo how things work.

* Updating docs, updating readme

* Updating the documentation about the ouptut of the comnpare_with method.

* Reduced docstring for from_json_schema

* Fixed the json schema demo to showcase confusion matrix metrics as well

---------

Co-authored-by: ayushi1208 <ash264@cornell.edu>

* Added a guide on dynamic creation of StructuredModel (#30)

* removed kiro documents

* Feature/html reporting (#24)

* Added basic html reporting

* Reorganized the html reporting

* Cleaning up HTML report code

* Debugging document images showing up on the HTML report

* Cleaned up css and js file, added pdf compatibility:

* Fixing security issues regarding try-except

* Added test cases and fixed bugs

* moved Readme location for html reporting

* Addressed PR comments regarding html.escape() and color threshold in ReportConfig

* Updated test cases for reporting

* Adding logger instead of print statements for html reporter

* Added pypi release pipeline (#31)

* Added pypi release pipeline

* commented out pypi, testing only test pypi

* Testing out 0.1.3 on test pypi

* Added pypi to the release workflow

* Addressing failing test cases

* Addressing failing test case

* Pinned ubuntu version to 24.04 for the pypi build

* fix: adding fixes for ash scan and adding ash to github security workflow

* fix: fixing ash output format

* Removing a GC collect entry, to speed up comparison. (#32)

* Removing a GC collect entry, to speed up comparison.

---------

Co-authored-by: ayushi1208 <ash264@cornell.edu>

* fixed security issue about github actions permissions (#38)

Github workflow for release updated.

---------

Co-authored-by: Spencer Romo <sromo@amazon.com>
Co-authored-by: Spencer Romo <136653019+sromoam@users.noreply.github.com>
Co-authored-by: Aditya Addepalli <adiadd@amazon.com>
Co-authored-by: aditya <adi.addepalli@gmail.com>
Co-authored-by: ayushi1208 <ash264@cornell.edu>
hayleypark pushed a commit that referenced this pull request Jan 28, 2026
* Refining the strucuted object monolith.

* Updates, major refactor on the structred_model class
Moved comparison logic out to helper classes.
Validated test are passing.

* Updates to remove more bulk
* Delegating to classes, helper functions.

* Updating the Tests to fix the broken test expecataion.
Pushing further reduction to structured model.

* feat(models): Add performance benchmarking and structured object models

- Create new `__init__.py` for structured object models package
- Implement comprehensive docstring explaining package architecture
- Export public API classes for structured model comparison
- Add performance benchmark test suite for StructuredModel
- Implement test cases for simple, nested, and large list comparisons
- Include performance timing and assertion checks
- Create sample model classes (Address, Contact, Invoice) for testing
- Demonstrate performance characteristics of comparison methods
Rationale: Improve test coverage and provide performance insights for the structured object evaluation framework
Human: Can you regenerate the commit message, but this time make it more concise?

* docs(refactoring): Add comprehensive StructuredModel refactoring documentation

- Create detailed documentation for StructuredModel architectural refactoring
- Describe migration from monolithic 2584-line implementation to modular design
- Outline new architecture using delegation pattern with specialized components
- Provide architecture overview, component responsibilities, and extension guidelines
- Include code examples and architectural diagrams to explain refactoring approach
- Maintain 100% backward compatibility with existing system
- Improve system maintainability and extensibility through modular design

* Reducing the iterations and increasing time expectations

* Removing unused variables.

* Removing dead code paths.

* Few more changes based on the feedback.

* Removing an unused function.

* Using the ResultHelper class to generate output.

* Fix/mkdocs to dev (#27)

* Merge branch 'main' into dev

* Added .DS_Store to .gitignore

* JSON Schema based construction, reference Issue # 18 (#20)

* feat(models): Add JSON Schema field converter for structured object models

- Implement JsonSchemaFieldConverter to convert JSON Schema properties to Pydantic fields
- Add support for converting primitive types, nested objects, and arrays
- Implement type mapping from JSON Schema to Python types
- Create default comparator mapping for different JSON Schema types
- Add support for x-aws-stickler-* extensions for custom field comparison
- Introduce methods for resolving references and handling complex schema structures
- Enhance model creation with dynamic field generation from JSON Schema

* Adding teests, for complex objects from the ocr-benchmark.

* Alright, more schema method improvements.

* Adding the update to the toml file.

* Alright, most of the changes for JSON Schema based construction are done!

* Updating the documentation to demo how things work.

* Updating docs, updating readme

* Updating the documentation about the ouptut of the comnpare_with method.

* Reduced docstring for from_json_schema

* Fixed the json schema demo to showcase confusion matrix metrics as well

---------

Co-authored-by: ayushi1208 <ash264@cornell.edu>

* Added a guide on dynamic creation of StructuredModel (#30)

* removed kiro documents

* Feature/html reporting (#24)

* Added basic html reporting

* Reorganized the html reporting

* Cleaning up HTML report code

* Debugging document images showing up on the HTML report

* Cleaned up css and js file, added pdf compatibility:

* Fixing security issues regarding try-except

* Added test cases and fixed bugs

* moved Readme location for html reporting

* Addressed PR comments regarding html.escape() and color threshold in ReportConfig

* Updated test cases for reporting

* Adding logger instead of print statements for html reporter

* Added pypi release pipeline (#31)

* Added pypi release pipeline

* commented out pypi, testing only test pypi

* Testing out 0.1.3 on test pypi

* Added pypi to the release workflow

* Addressing failing test cases

* Addressing failing test case

* Pinned ubuntu version to 24.04 for the pypi build

* fix: adding fixes for ash scan and adding ash to github security workflow

* fix: fixing ash output format

* Removing a GC collect entry, to speed up comparison. (#32)

* Removing a GC collect entry, to speed up comparison.

---------

Co-authored-by: ayushi1208 <ash264@cornell.edu>

* fixed security issue about github actions permissions (#38)

Github workflow for release updated.

---------

Co-authored-by: Spencer Romo <sromo@amazon.com>
Co-authored-by: Spencer Romo <136653019+sromoam@users.noreply.github.com>
Co-authored-by: Aditya Addepalli <adiadd@amazon.com>
Co-authored-by: aditya <adi.addepalli@gmail.com>
Co-authored-by: ayushi1208 <ash264@cornell.edu>
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