-
Notifications
You must be signed in to change notification settings - Fork 0
Add load_benchmark_data management command for performance testing #6
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
Add load_benchmark_data management command for performance testing #6
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.
Pull request overview
This PR refactors a Django management command for loading benchmark data, adding configurability through command-line arguments and introducing new functionality for creating images and snippets. However, the refactoring introduces several critical bugs and removes important functionality.
Key Changes:
- Added command-line arguments to configure benchmark data quantities (pages, blocks, images, snippets, etc.)
- Implemented benchmark image creation using PIL instead of fixture files
- Added bulk snippet creation for BreadType, Country, and BreadIngredient models
- Restructured code into smaller methods with progress reporting
- Removed transaction wrapping and duplicate-checking logic from page creation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ingredients = [BreadIngredient(name=f"Ingredient {i * j + 1}") for j in range(batch_size)] | ||
| BreadIngredient.objects.bulk_create(ingredients, ignore_conflicts=True) | ||
|
|
||
| created_count += batch_size*3 |
Copilot
AI
Dec 26, 2025
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.
The expression 'batch_size*3' should have spaces around the multiplication operator for better readability and consistency with Python style guidelines (PEP 8).
| created_count += batch_size*3 | |
| created_count += batch_size * 3 |
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 14 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 15 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Implements GitHub issue wagtail#570 by adding a
load_benchmark_datamanagement command to generate large-scale benchmark content for Wagtail performance testing.The command allows configurable creation of pages, StreamField content, InlinePanel items, revisions, images, snippets, and translations.
Usage
Key Options (defaults)
--blog-pages-count (100000)
--streamfield-blocks-count (100)
--streamfield-depth (10)
--inline-panel-items-count (100)
--paragraphs-count (100)
--revisions-per-page-count (100000)
--page-tree-depth (10)
--images-count (100)
--snippets-count (100000)
--translations-count (100)
What This Adds
Large numbers of BlogPage instances with deep page trees
StreamField content with up to 100 blocks and 10 levels of nesting
Rich text content with configurable paragraph counts
InlinePanel data (100 items per sample page)
Page revisions for revision-scale testing
Generated placeholder images
Bulk-created snippets
Locale creation and translated page copies
Issue wagtail#570 Coverage
100 StreamField blocks
10 levels of StreamField nesting
100 InlinePanel items
100 rich text paragraphs
100k+ pages (configurable)
Deep page tree
Large revision counts
Images and snippet scale
Up to 100 translations