Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/#2790/fix algorithm caching in optcahed #2812

Conversation

Yanich96
Copy link
Contributor

@Yanich96 Yanich96 commented Jan 23, 2024

Closed: #2790

What's done:

The caching algorithm was fixed: now last modifications time of cached file must be later or equal than last modifications time of program file.
The caching process can be faster if the xml file is not read. A task was added so that the file name is not taken from the file attributes.


PR-Codex overview

This PR focuses on optimizing the caching mechanism in the OptCached class. It includes the following changes:

  • Updated the OptCached class to use the path of the XML program instead of the XML object itself.
  • Modified the apply method in OptCached to handle the path parameter instead of the XML parameter.
  • Refactored the cached method in OptCached to use the path of the XML program instead of the XML object itself.
  • Refactored the contains method in OptCached to use the path of the XML program instead of the XML object itself.
  • Updated the Optimization interface to extend Func<Path, XML> instead of Function<XML, XML>.

The following files were skipped due to too many changes: eo-maven-plugin/src/test/java/org/eolang/maven/optimization/OptCachedTest.java

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@Yanich96 Yanich96 closed this Jan 23, 2024
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.

OptCached.java:44-51: Fix caching mechanism in {@link...
1 participant