Skip to content

endpoint: optimize __eq__ via product_id#14806

Merged
Maffooch merged 1 commit intoDefectDojo:bugfixfrom
valentijnscholten:perf/endpoint-equality-optimize
May 6, 2026
Merged

endpoint: optimize __eq__ via product_id#14806
Maffooch merged 1 commit intoDefectDojo:bugfixfrom
valentijnscholten:perf/endpoint-equality-optimize

Conversation

@valentijnscholten
Copy link
Copy Markdown
Member

@valentijnscholten valentijnscholten commented May 4, 2026

The Endpoint equality method compares the full self.product fields. This can trigger a query to get the product details and sometimes results in a 1+N query pattern, for example during previewing of deletes.

This PR switches to comparing self.product_id.

The equivalent Location models don't have an equality method.

@valentijnscholten valentijnscholten added this to the 2.58.1 milestone May 4, 2026
@Maffooch Maffooch requested review from Jino-T, blakeaowens and dogboat May 5, 2026 01:01
Copy link
Copy Markdown
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

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

Approved

@Maffooch Maffooch merged commit 43ebacd into DefectDojo:bugfix May 6, 2026
156 checks passed
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.

5 participants