1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-25 15:37:42 +00:00
Commit Graph

301 Commits

Author SHA1 Message Date
Thaddeus Crews
15cd5e1619 Merge pull request #106689 from aaronp64/ringbuffer_localvector
Use `LocalVector` for `RingBuffer`
2025-05-22 12:15:03 -05:00
Thaddeus Crews
c3c3657a0d Merge pull request #106661 from KirbyRider1337/dont-compare-the-same-item-with-itself
Prevent comparison of items with themselves while partitioning sort arrays
2025-05-22 12:14:58 -05:00
KirbyRider1337
caf8053b86 Adjusted get_median_from_3 and partitioner to also retrieve the pivot's index and check if either end of the partitioner has reached it to avoid comparing things with themselves 2025-05-21 14:38:09 -04:00
aaronp64
2a02cabe4d Use LocalVector for RingBuffer
Updated RingBuffer to use LocalVector instead of Vector, to avoid _copy_on_write overhead when writing to the buffer.
2025-05-21 13:50:10 -04:00
Lukas Tenbrink
70f8dd29f5 Simplify use of LocalVector force_trivial template parameter. 2025-05-19 20:27:14 +02:00
Thaddeus Crews
2d42b889d1 Merge pull request #104124 from Ivorforce/alloc-static-calloc
Add `Memory::alloc_static_zeroed` to allocate memory that's filled with zeroes.
2025-05-19 08:01:33 -05:00
Thaddeus Crews
5538850d87 Core: Convert Pair/KeyValue to constexpr 2025-05-15 10:37:41 -05:00
Yufeng Ying
3bf400ffae Move bisect to Span and deduplicate code.
Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
2025-05-14 18:19:09 +08:00
Yufeng Ying
0babb2ab02 Optimize HashMap size for zero-sized Allocators. 2025-05-13 21:44:39 +08:00
Lukas Tenbrink
3207066e19 Add Memory::alloc_static_zeroed to allocate memory that's filled with zeroes.
This is generally faster than `malloc` followed by `memset` / loop-set to 0.
2025-05-13 01:57:05 +02:00
Rémi Verschelde
4c62c8aceb Merge pull request #106020 from Ivorforce/hashmap-duplicate-hash
Optimize `HashMap` insertion by removing duplicate computation of hash and position
2025-05-13 01:04:57 +02:00
Rémi Verschelde
2b037e8989 Merge pull request #93276 from mashumafi/avoid-vec-copy
Avoid unnecessary copy-on-write Vector/Array
2025-05-13 01:04:16 +02:00
mashumafi
b73346ef19 Avoid copy-on-write when reading vectors 2025-05-12 16:08:05 +02:00
Yufeng Ying
2db0a44519 Remove vmap.h 2025-05-09 19:05:28 +08:00
Lukas Tenbrink
1d49a557b6 Optimize away duplicate hash and position computation in HashMap on insert.
Co-authored-by: Nazarii <nazarii.yablonskyi.pp.2022@lpnu.ua>
2025-05-02 19:02:03 +02:00
Thaddeus Crews
01fc9aee6c Core: Modernize C headers with C++ equivalents 2025-05-02 08:23:01 -05:00
Lukas Tenbrink
1b1ab76a14 Add FixedVector template.
This is a high performance `Vector`-like object that can be used if the maximum number of objects is small and known, and the objects are needed only temporarily.
2025-04-30 19:14:08 +02:00
Thaddeus Crews
44d20b2dc6 Merge pull request #100619 from Ivorforce/cowdata-resize-direct
Optimize / refactor `CowData`, combining resize and fork to avoid unnecessary reallocations.
2025-04-28 18:45:54 -05:00
lawnjelly
ae04a3a5dd Physics Interpolation - Move 3D FTI to SceneTree
Moves 3D interpolation from server to the client code (`SceneTree`).
Complete rework of 3D physics interpolation, but using the same user API.
2025-04-26 14:13:30 +01:00
Lukas Tenbrink
d74ef8cb01 Rename LocalVector.invert() -> LocalVector.reverse() to match the Vector, String and List APIs. 2025-04-24 22:36:32 +02:00
Lukas Tenbrink
7c37188ca1 Smoke test: In collections, log an error if reserve() is called with a number smaller than the current size. Don't log an error if it is called with a number smaller than the current capacity. 2025-04-23 16:47:47 +02:00
Thaddeus Crews
2ffd5a3913 Merge pull request #104738 from YYF233333/cleanup_rid_owner
Use `LocalVector` in `RID_Owner::get_owned_list`
2025-04-22 10:44:25 -05:00
Thaddeus Crews
c0e695d5e8 Merge pull request #100944 from Nazarwadim/LocalVector_use_1.5x_growth_factor
Use 1.5x growth factor for LocalVector
2025-04-21 08:24:22 -05:00
Yyf2333
1a70a06a43 Change RID_Owner::get_owned_list. 2025-04-21 01:04:27 +08:00
clayjohn
c6c06a966a Allow chunk validator to wrap around in RID_Alloc so that we do not need to crash once we have made 2^31 allocations 2025-04-18 00:06:53 -07:00
Lukas Tenbrink
015a3b0434 Optimize / refactor CowData, combining resize and fork to avoid unnecessary reallocations. 2025-04-15 17:01:26 +02:00
Thaddeus Crews
addab4f001 Merge pull request #95916 from Repiteo/core/bit-field
Core: Add dedicated `BitField` template
2025-04-11 13:29:13 -05:00
Thaddeus Crews
0d267e7b1e Core: Add dedicated BitField template 2025-04-11 11:53:26 -05:00
Lukas Tenbrink
b711d72e8f Remove unnecessary friend class declarations of CowData.
Use default implementations for various containers.
2025-04-11 18:26:08 +02:00
Thaddeus Crews
94282d88f9 Core: Use Math namespace for constants 2025-04-10 16:29:30 -05:00
Thaddeus Crews
5edb235018 CI: Bump various pre-commit hooks 2025-04-07 08:23:35 -05:00
Thaddeus Crews
207a2b6472 Core: Integrate warning suppression macro helpers 2025-04-03 10:13:46 -05:00
Lukas Tenbrink
ccdc5862e9 Add LocalVector.erase_unordered, mimicking erase but with remove_at_unordered, to remove duplicate logic.
`erase_unordered` should be preferred over `erase` where order is not important, for its performance benefits.

Co-authored-by: smix8 <smix8@users.noreply.github.com>
2025-03-31 13:31:53 +02:00
Rémi Verschelde
afc7398c2b Merge pull request #104616 from ibrahn/init-cmd-q-pending-and-gles3-skymatdata
Fix uninitialized member vars in CommandQueueMT and RasterizerSceneGLES3
2025-03-28 17:30:37 +01:00
Rémi Verschelde
4a31936bc1 Merge pull request #104693 from mihe/local-vector-move
Optimize `LocalVector::push_back` for non-trivial objects
2025-03-28 14:34:49 +01:00
Rémi Verschelde
76c30189fa Merge pull request #103923 from Ivorforce/span-array-init
Add C array constructor to `Span`.
2025-03-28 14:32:14 +01:00
Mikael Hermansson
5c5b9847da Optimize LocalVector::push_back for non-trivial objects 2025-03-27 14:22:30 +01:00
Ibrahn Sahir
c9352f06f7 Fix uninitialised member vars in CommandQueueMT and RasterizerSceneGLES3 2025-03-25 17:19:16 +00:00
Thaddeus Crews
8f16b86d7e Core: Include intrin.h for MSVC 2025-03-24 15:19:49 -05:00
Thaddeus Crews
4c9086312d Merge pull request #103698 from AThousandShips/fix_a_hash_map_construct
[Core] Fix `AHashMap` constructors reserving too few elements
2025-03-23 19:03:59 -05:00
Thaddeus Crews
f09ee0171a Style: Begin integrating simple .clangd fixes 2025-03-22 13:24:35 -05:00
Rémi Verschelde
64bd03269f Merge pull request #104286 from Ivorforce/localvector-find
Harmonize `String`, `Vector` and `LocalVector` `find` and `rfind`.
2025-03-19 12:27:27 +01:00
Lukas Tenbrink
fde71e0382 Harmonize String, Vector and LocalVector find and rfind.
Use `Span::find` for `LocalVector::find`, accepting negative `p_from`.
Return `-1` for invalid `p_from` values in `rfind`.
Accept negative values for `p_from` in `find`, starting from the back.
2025-03-18 12:37:36 +01:00
Thaddeus Crews
4320800621 Core: Expand is_zero_constructible coverage 2025-03-17 11:45:26 -05:00
Lukas Tenbrink
49e860159a Move CowData find, rfind and count to Span. 2025-03-16 03:31:11 +01:00
Lukas Tenbrink
78221946cc Add C array constructor to Span. [skip ci] 2025-03-12 16:48:16 +01:00
Thaddeus Crews
74907876d3 Merge pull request #103759 from Ivorforce/zero-constructible
Optimize `Array.resize` by using `memset` (through new `is_zero_constructible` type trait)
2025-03-12 10:31:55 -05:00
Lukas Tenbrink
75bc471965 Add is_zero_constructible to denote if a type can be semi-trivially constructed with all 0 bytes.
Optimize `CowData` and `LocalVector` resize for zero constructible types.
Mark several compatible types as `is_zero_constructible`.
2025-03-12 09:49:24 +01:00
Lukas Tenbrink
55a7de93c7 Add iteration to Span. 2025-03-11 23:46:25 +01:00
Lukas Tenbrink
f5cb739a18 Add Span conversion to LocalVector. 2025-03-10 22:30:39 +01:00