-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
not prefetching images when not needed #8676
Merged
Merged
Changes from 6 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e7d7860
not prefetching images when not needed
Eldies 1c59e50
fixing tests
Eldies b205652
changelog entry
Eldies 3a5a26d
do not prefetch video
Eldies a091103
prefetch_images=False by default
Eldies ccc7be9
Update changelog.d/20241113_130658_dmitrii.lavrukhin_no_queryset_cach…
Eldies 9f2d2f2
fix changelog entry
Eldies 70bb001
Merge branch 'refs/heads/develop' into dl/no-queryset-cache
Eldies a008601
removing is_prefetched option
Eldies 0dad09b
returning is_prefetched option with the other name
Eldies 80b8bb9
Merge branch 'refs/heads/develop' into dl/no-queryset-cache
Eldies 90d8c0e
Merge branch 'refs/heads/develop' into dl/no-queryset-cache
Eldies fa45afa
sharing db_task from TaskAnnotation to JobAnnotation
Eldies 5d8fe3e
Update cvat/apps/dataset_manager/task.py
Eldies 46ae39f
not prefetching project owner/assignee
Eldies 2c84472
fixing jobs prefetching
Eldies a1994e5
querying jobs for JobAnnotation in TaskAnnotation
Eldies 8a24718
type annotations
Eldies 2c62ab7
Merge branch 'refs/heads/develop' into dl/no-queryset-cache
Eldies 0c9388f
locking jobs in TaskAnnotation.init_from_db
Eldies 021de6e
making db_job params kw only
Eldies File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
changelog.d/20241113_130658_dmitrii.lavrukhin_no_queryset_cache.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
### Fixed | ||
|
||
- Optimized memory consumption and reduced the number of database queries when importing annotations to a task with a lot of jobs and images | ||
(<https://github.com/cvat-ai/cvat/pull/8676>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
FYI, I don't think this impacts memory use heavily at the moment. It seems that using
select_related
results in differentSegment
andTask
objects in Python, even if they are actually the same DB line.prefetch_related
, however, results in the same objects with the same ids. As there are many segments using the same task, it makes sense to useprefetch_related
instead in such cases, if memory use is the question.prefetch_related
will result in a separate requests though.