-
-
Notifications
You must be signed in to change notification settings - Fork 407
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: fix and speed up CSV export #8863
Conversation
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.
Looks good to me. Have you try how much time take the sort?
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.
Cool !
scripts/export_database.pl
Outdated
print "cached_display_taxonomy_tag_calls: $cached_display_taxonomy_tag_calls\n"; | ||
print "cached_display_taxonomy_tag_misses: $cached_display_taxonomy_tag_misses\n"; |
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.
to remove ?
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 removed it, thanks
you need a |
Co-authored-by: Alex Garel <[email protected]>
Co-authored-by: Alex Garel <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #8863 +/- ##
==========================================
- Coverage 48.61% 48.59% -0.02%
==========================================
Files 118 118
Lines 22069 22077 +8
Branches 4903 4904 +1
==========================================
Hits 10728 10728
- Misses 10038 10046 +8
Partials 1303 1303
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Kudos, SonarCloud Quality Gate passed! |
The sort is now done after the CSV file is generated.
(all numbers below on a small database of 12K products)
The display_taxonomy_tag() calls are used to translates values of fields like categories_tags in their English and French names. There are lots of repeated values, so we can try caching them.
Added a cached_display_taxonomy_tag() function in Tags.pm to keep a cache (simple hash).
After:
Typical runs:
Before:
--- not cached:
real 0m30.468s
user 0m28.947s
sys 0m1.093s
real 0m31.633s
user 0m30.102s
sys 0m1.101s
real 0m32.819s
user 0m31.207s
sys 0m1.173s
After:
--- cached:
cached_display_taxonomy_tag_calls: 742838
cached_display_taxonomy_tag_misses: 15390
real 0m26.765s
user 0m25.185s
sys 0m1.158s
real 0m28.247s
user 0m26.808s
sys 0m1.012s
real 0m25.590s
user 0m24.114s
sys 0m1.068s