-
Notifications
You must be signed in to change notification settings - Fork 330
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
ImmediatlyWriteZip #1416
Conversation
…instead of creating single files.
Should fix #1212 |
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")); |
There was a problem hiding this comment.
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.
core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java
Outdated
Show resolved
Hide resolved
core/src/test/java/de/jplag/reporting/reportobject/ReportObjectFactoryTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/de/jplag/reporting/reportobject/ReportObjectFactoryTest.java
Outdated
Show resolved
Hide resolved
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). |
core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java
Show resolved
Hide resolved
@TwoOfTwelve we have one conflict here. |
There was a problem hiding this 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
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.