Skip to content

Conversation

@itzpr3d4t0r
Copy link
Member

@itzpr3d4t0r itzpr3d4t0r commented Jul 7, 2024

A previous PR (#2679) improved the fblits function by condensing the core loop into a separate function. However, this change slightly impacted performance, particularly with small surfaces, which are the primary focus of the fblits function. This new PR aims to restore the original performance without significantly increasing the code size.

Interestingly, the results are as follows:

New: 234,496 bytes
Old: 235,008 bytes

This minor discrepancy of 512 bytes represents a 0.2% increase in code size, which is negligible.
image
The test demonstrates a 10x10 pixel surface being drawn onto a 1000x1000 screen, with the x-axis representing the number of surfaces drawn.

@itzpr3d4t0r itzpr3d4t0r added Performance Related to the speed or resource usage of the project Surface pygame.Surface labels Jul 7, 2024
@itzpr3d4t0r itzpr3d4t0r requested a review from a team as a code owner July 7, 2024 21:21
@itzpr3d4t0r itzpr3d4t0r changed the title Restore inlining for fblits() internal functionality Restore inlining for .fblits() internal functionality Jul 7, 2024
Copy link
Member

@oddbookworm oddbookworm left a comment

Choose a reason for hiding this comment

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

The minor filesize change is fine with me, I support it in favor of the speed diffs you show

Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

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

LGTM, 512 bytes are not a big deal.

@damusss damusss added this to the 2.5.1 milestone Jul 8, 2024
@damusss damusss merged commit 2b088c9 into pygame-community:main Jul 8, 2024
@itzpr3d4t0r itzpr3d4t0r deleted the restore_fblits_inline branch July 8, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Performance Related to the speed or resource usage of the project Surface pygame.Surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants