-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
perf(export): export generates unnecessary files content #26765
perf(export): export generates unnecessary files content #26765
Conversation
Hello @Always-prog thanks for the PR! Would you mind taking a look at the failing CI steps? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #26765 +/- ##
==========================================
+ Coverage 67.18% 69.51% +2.33%
==========================================
Files 1900 1900
Lines 74443 74491 +48
Branches 8293 8293
==========================================
+ Hits 50012 51785 +1773
+ Misses 22376 20651 -1725
Partials 2055 2055
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@betodealmeida Hi! Thanks for review! I have committed fixes by your comments. But the only thing that pre-commit fails due to file .github/workflows/update-monorepo-lockfiles.yml, which I have not fixed. |
Hi @Always-prog it seems you have a conflicting file. Can you fix it, please? I am adding myself as a reviewer and checking back on this asap. Thank you! |
👀 |
@geido Hi! Rebased! |
/testenv up |
@geido Ephemeral environment spinning up at http://54.191.84.78:8080. Credentials are |
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.
I tested the PR and was able to successfully export/import dashboards.
Thank you for the work @Always-prog, the performance improvements are impressive!
@michael-s-molina Thank you for testing my PR. Can I get merge? |
Ephemeral environment shutdown and build artifacts deleted. |
SUMMARY
Currently, exporting models functionality is slower than it can be.
Model export is slow because models export their related models, and since related models cannot check if they have already been exported to the final archive, they are exported anyway. This leads to generating unnecessary export model files.
For example, exporting a dashboard with 2 charts will generate 4 files - a dashboard, two charts, a dataset, and a database, but ““behind the scenes” there will actually be 7 files generated, since each chart will re-export the dataset and database, and at the end, the highest-level export model (dashboard export) will remove these duplicates.
To solve this problem, it is proposed to start generating export files not immediately, but only when they are written to a file, by convert
file_content
to function that generates content when we call it.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
pay attention to speed up of generating an dashboard export archive!
Before
without-perf.mp4
After
with-perf.mp4
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION