Opened 2 hours ago

Last modified 7 minutes ago

#37125 new Cleanup/optimization

Use __new__ to sanitize TaskResult instead of __post_init__ to half memory usage

Reported by: Johannes Maron Owned by:
Component: Tasks Version: dev
Severity: Normal Keywords:
Cc: Johannes Maron Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Jake and I have been discussing changes to the Task framework for 6.2 with a focus on performance and versatility.

One discovery was the memory overhead created by __post_init__ which doubles the working memory when compared to a factory method.

A __new__ method is what I used in the benchmark and what I would consider the most Pythonic way while also maintaining full compatibility.

Change History (1)

comment:1 by Jacob Walls, 7 minutes ago

Can you share the benchmark script? I'd like to just eyeball the setup before drawing conclusions.

Note: See TracTickets for help on using tickets.
Back to Top