Description
Issue №3343 opened by itzpr3d4t0r at 2022-07-26 16:44:20
# Info
(This follows # 3324 rationale)
The Vector theme has come up multiple times on Discord: we concluded that vectors are underrated and should use more love from the community and us interns.
As a pygame user, I've generally avoided using Vector2 for my projects in favour of either an x and y attribute in a slotted class or a general pos. This is a shame because I've always been fascinated by what vectors can offer in terms of functionality and code simplification and always wanted to switch.
The reason is performance: the same program with vectors did not yield good performance compared to a vector-free program.
I have therefore started an effort to optimize the current vector functions while keeping compatibility with the current use, all in hope of encouraging people to do the switch over without suffering any performance regressions.
Comments
# # itzpr3d4t0r commented at 2022-08-01 09:16:09
An update on this. If we want to optimize many functions inside math.c, i will need new API functions that are more performant. That is because using new API reduces code duplication, improves code clarity and makes it more performant.
I have already started work on three new functions for extracting ints from objects, but for vectors i will need three more functions for doubles, as vectors use double as coords and a user is likely to pass vector-like objects that use doubles as well.
For now work on vector improvements is therefore paused until these new functions get implemented, approved and merged.