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

ImmediatlyWriteZip #1416

Merged
merged 3 commits into from
Feb 2, 2024
Merged

ImmediatlyWriteZip #1416

merged 3 commits into from
Feb 2, 2024

Conversation

TwoOfTwelve
Copy link
Contributor

@TwoOfTwelve TwoOfTwelve commented Dec 5, 2023

Changed the report object factory to immediately write to a zip file instead of creating single files.

I tried to check how the runtime changed, by running jplag over 100 copies of the jplag code.
This is the result:

old:
8:10.19
7224.86s user 29.80s system

new:
7:46.55
6893.25s user 28.17s system

The majority of the time however was spent on comparing the submissions, so this might not be representative.

I build an artificial "worst-case" scenario to check the speed and both the old and the new version took the same time.

@TwoOfTwelve TwoOfTwelve requested review from tsaglam and Kr0nox and removed request for tsaglam December 5, 2023 13:48
@TwoOfTwelve
Copy link
Contributor Author

Should fix #1212

@tsaglam tsaglam added enhancement Issue/PR that involves features, improvements and other changes minor Minor issue/feature/contribution/change labels Dec 5, 2023
@tsaglam
Copy link
Member

tsaglam commented Dec 7, 2023

As discussed, let's test how the performance is changed for a larger data set and include it in the PR description.

@@ -76,10 +77,10 @@ public static void main(String[] args) {
if (!parseResult.isUsageHelpRequested() && !(parseResult.subcommand() != null && parseResult.subcommand().isUsageHelpRequested())) {
JPlagOptions options = cli.buildOptionsFromArguments(parseResult);
JPlagResult result = JPlag.run(options);
ReportObjectFactory reportObjectFactory = new ReportObjectFactory();
reportObjectFactory.createAndSaveReport(result, cli.getResultFolder());
ReportObjectFactory reportObjectFactory = new ReportObjectFactory(new File(cli.getResultFolder() + ".zip"));
Copy link
Member

Choose a reason for hiding this comment

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

Why is ".zip" hardcoded here? I think this should be part of the factory and probably a constant.

@Kr0nox
Copy link
Member

Kr0nox commented Dec 14, 2023

What is the wanted behaviour, if jplag cant write the zip (can for example be forced by having a zip with the same name open).
Previously then you would still have the folder with the files. As I understand it, this will not happen now and the results are lost?

@tsaglam
Copy link
Member

tsaglam commented Jan 25, 2024

@TwoOfTwelve we have one conflict here.

Copy link
Member

@tsaglam tsaglam left a comment

Choose a reason for hiding this comment

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

@TwoOfTwelve can you resolve the conflicts so I can merge?

# Conflicts:
#	cli/src/main/java/de/jplag/cli/CLI.java
#	core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java
@tsaglam tsaglam merged commit 3442517 into develop Feb 2, 2024
12 checks passed
@tsaglam tsaglam deleted the feature/immediateZipFileCreation branch February 2, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue/PR that involves features, improvements and other changes minor Minor issue/feature/contribution/change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants