Redundant objects validation is visible for profiler #15

Merged
lee.miller merged 1 commits from lee.miller/MiNode:performance into v0.3 2024-10-23 23:56:00 +02:00
Collaborator

Hi!

I believe there is no need to check is_valid() in the Manager.clean_objects(). A sole case when an object can become invalid in the current design, I can see, is changing shared.stream, what is not supposed to be done in runtime. But .clean_objects() is run every 1.5 min and involves PoW check, including double composition (Object.to_bytes()).

Such amount of computations become visible for a profiler (See the green rectangle in the attached py-spy output).

Hi! I believe there is no need to check `is_valid()` in the `Manager.clean_objects()`. A sole case when an object can become invalid in the current design, I can see, is changing `shared.stream`, what is not supposed to be done in runtime. But `.clean_objects()` is run every 1.5 min and involves PoW check, including double composition (`Object.to_bytes()`). Such amount of computations become visible for a profiler (See the green rectangle in the attached py-spy output).
lee.miller added 1 commit 2024-09-24 19:22:18 +02:00
lee.miller force-pushed performance from 201acb9195 to 70f059d9b1 2024-10-23 00:37:55 +02:00 Compare
lee.miller requested review from PeterSurda 2024-10-23 01:08:43 +02:00
PeterSurda approved these changes 2024-10-23 07:22:42 +02:00
PeterSurda left a comment
Owner

Looks ok

Looks ok
lee.miller merged commit 70f059d9b1 into v0.3 2024-10-23 23:56:00 +02:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Bitmessage/MiNode#15
No description provided.