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

Optimize report viewer dto size new #535

Merged

Conversation

nestabentum
Copy link
Contributor

Ready for review version of PR #507.

The new file format . Consists of

  • an overview.json file: it contains all data for the overview page (metadata about the JPlag run, distributions, top comparisons)
  • a file submissionX-submissionY.json for each comparison. The json contains info about the matches in a comparison. This file does not contain any submission code anymore.
  • a folder Submissions that has a subfolder submissionX for each submission. The subfolder submissionX contains all original files of the submission.

This file format significantly decreases the report's total size needed.
This PR should also fix crashes/lagging while reporting when handling large submissions.

@nestabentum nestabentum force-pushed the optimize_reportViewer_dto_size_new_ready branch from 8e91602 to eba678e Compare July 28, 2022 11:08
@sebinside sebinside self-requested a review July 28, 2022 11:15
Copy link
Member

@dfuchss dfuchss left a comment

Choose a reason for hiding this comment

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

Code review of the java part (not tested yet :))

@tsaglam tsaglam requested a review from a team July 28, 2022 13:09
Copy link
Member

@sebinside sebinside left a comment

Choose a reason for hiding this comment

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

Here are a few comments on the code.

I also tested your version with a zip file with 50 submissions and around 1000 comparisons:

  • No more file already exists exceptions, thank you
  • Switching to max similarity (and back) freezes the site for about 30 seconds
  • Is the distribution y-axis flipped?
  • I still get an error on the comparison view, here is the log:
    Uncaught (in promise) TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at Function.from (<anonymous>)
    at Object.eval (store.ts?502f:32:1)
    at ComparisonFactory.getComparison (ComparisonFactory.ts?d6d7:5:1)
    at setup (index.js?e1de:60:1)
    at callWithErrorHandling (runtime-core.esm-bundler.js?d2dd:155:1)
    at setupStatefulComponent (runtime-core.esm-bundler.js?d2dd:7165:1)
    at setupComponent (runtime-core.esm-bundler.js?d2dd:7119:1)
    at mountComponent (runtime-core.esm-bundler.js?d2dd:5473:1)
    at processComponent (runtime-core.esm-bundler.js?d2dd:5448:1)
    at patch (runtime-core.esm-bundler.js?d2dd:5038:1)
    

@nestabentum
Copy link
Contributor Author

nestabentum commented Jul 29, 2022

@sebinside thanks for the feedback!

  • Switching to max similarity (and back) freezes the site for about 30 seconds

I will look into what causes this.

  • Is the distribution y-axis flipped?

I swore I had flipped the labels it alongside the data generation.. Fixed the labels.

  • I still get an error on the comparison view, here is the log:
    Uncaught (in promise) TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at Function.from (<anonymous>)
    at Object.eval (store.ts?502f:32:1)
    at ComparisonFactory.getComparison (ComparisonFactory.ts?d6d7:5:1)
    at setup (index.js?e1de:60:1)
    at callWithErrorHandling (runtime-core.esm-bundler.js?d2dd:155:1)
    at setupStatefulComponent (runtime-core.esm-bundler.js?d2dd:7165:1)
    at setupComponent (runtime-core.esm-bundler.js?d2dd:7119:1)
    at mountComponent (runtime-core.esm-bundler.js?d2dd:5473:1)
    at processComponent (runtime-core.esm-bundler.js?d2dd:5448:1)
    at patch (runtime-core.esm-bundler.js?d2dd:5038:1)
    

That's weird I don't get an error...
What version/branch of the ReportViewer did you test? This branch?

@nestabentum
Copy link
Contributor Author

@sebinside I don't think there is a quick fix for the slow performance when switching metrics: rendering 1000 DOM Elements (especially with Vue's v-for) is expensive. Possible solutions I found include:

Of course, we should not build Pagination ourselves but rely on an existing implementation - we could and maybe even should adopt a UI Framework like BootStrapVue, Vuetify, etc...

@sebinside
Copy link
Member

sebinside commented Jul 30, 2022

@nestabentum I totally understand that rendering so many elements takes time. However, the initial loading of the site (where the AVG metrics are rendered) takes significantly less time. That's why I wondered...

Regarding the error: I checked out the branch of this PR and built the web viewer locally... I might have another look at it next week

@dfuchss
Copy link
Member

dfuchss commented Jul 30, 2022

@nestabentum can you merge the current master branch into you branch. Afterwards, the SonarCloud scan will work again :)

@nestabentum nestabentum force-pushed the optimize_reportViewer_dto_size_new_ready branch from 49eca21 to 1970f8b Compare July 30, 2022 13:46
Copy link
Member

@dfuchss dfuchss left a comment

Choose a reason for hiding this comment

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

Some minor remarks

@tsaglam
Copy link
Member

tsaglam commented Aug 1, 2022

As far as I can see, the addressed requested changes need approval by @dfuchss and @sebinside here.

@sebinside
Copy link
Member

@nestabentum From looking at the changes, everything should be fine. However, the error in the comparison viewer still persists at least for me. I checked out a fresh version of this PR, tested multiple data sets, no success. I don't know whether this is only a problem in my installation.

So I would guess, if no one is able replicate this problem, and the merge conflicts are resolved, this PR can be merged.

@tsaglam
Copy link
Member

tsaglam commented Aug 3, 2022

So I would guess, if no one is able replicate this problem, and the merge conflicts are resolved, this PR can be merged.

There are some conflicts with the master branch. @nestabentum needs to solve them before we can merge.

Copy link
Member

@dfuchss dfuchss left a comment

Choose a reason for hiding this comment

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

As my comments are not that critical , I approve it :)

@nestabentum nestabentum force-pushed the optimize_reportViewer_dto_size_new_ready branch from 8960e59 to a90e479 Compare August 3, 2022 15:44
@nestabentum nestabentum force-pushed the optimize_reportViewer_dto_size_new_ready branch from a90e479 to 7315125 Compare August 3, 2022 15:56
@nestabentum
Copy link
Contributor Author

Resolved all conversations and all merge conflicts, so this is good to go.

@sebinside Very peculiar, but I'm sure eventually, we'll get to the bottom of this :)

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

13.1% 13.1% Coverage
0.0% 0.0% Duplication

@tsaglam tsaglam merged commit 8d28e95 into jplag:master Aug 3, 2022
@sebinside sebinside mentioned this pull request Aug 6, 2022
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.

4 participants