Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Conversation

@sw-joelmut
Copy link
Collaborator

#minor

Description

This PR reduces the memory usage when parsing the LgFiles (lgParse.worker) by adding a MapOptimizer to the LgFilesCache.
This optimizer consists of, based on a capacity limit, the process will start removing LgFile parse results to free up space from memory. Additionally, it takes into account all the references and relationships between other LgFiles.

Note: The MapOptimizer capacity limit is set to store a maximum of 10 parsed LgFiles, this amount can be modified through code.

Screenshots

The following image shows loading 9 bot responses with the MapOptimizer capacity size of 3 (for testing purposes), seeing the improvement in memory usage.
image

@sw-joelmut sw-joelmut changed the title Optimize memory usage when parsing LgFiles fix: Optimize memory usage when parsing LgFiles Jul 21, 2023
@coveralls
Copy link

coveralls commented Jul 21, 2023

Coverage Status

coverage: 54.49% (-0.08%) from 54.567% when pulling 5c73b9d on southworks/add/map-optimizer into 8856d24 on main.

@OEvgeny
Copy link
Collaborator

OEvgeny commented Jul 24, 2023

Looks good, left a couple of comments to address.

Nice work!

@sw-joelmut
Copy link
Collaborator Author

Hi @OEvgeny, the suggestions are applied, thanks!

@OEvgeny OEvgeny merged commit 145acb8 into main Aug 1, 2023
@OEvgeny OEvgeny deleted the southworks/add/map-optimizer branch August 1, 2023 16:12
@cwhitten cwhitten mentioned this pull request Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants