1
0
Fork 0
godot/core
HP van Braam cccd2432c3 Refactor CommandQueueMT to use vararg templates
In order to make CommandQueueMT more maintainable this PR changes the
previous macro hell with variadic templates instead. This makes the
class far more explicit and will allow us to more easily change the way
the class functions in the future.

Furthermore this refactoring has allowed for some optimizations. In
particular by using std::forward to delay the decision of decaying the
type to as late as possible we are able to move the data from the
callsite into our Command buffer and later move it to the call.

In practice what this means is that compared to the old version instead
of copying values 3 times, we can now get away with 1 copy, and 1 move
for lvalues, and just 2 moves for rvalues. This saves quite a few
operations in a hot codepath.

We also now test to make sure that the amount of copies and moves are
what we expect. This way we can spot performance regressions in this
code easily.

Somewhat unscientifically, running TPS-demo by pressing enter and not
touching the controls average mspf, repeatable across many runs:

before: 6.467
after : 6.202
2025-01-02 15:35:08 +01:00
..
config Merge pull request #99010 from Hilderin/embedding-game-process 2024-12-20 23:56:43 +01:00
crypto Merge pull request #100564 from YYF233333/iwyu 2024-12-19 19:59:55 -06:00
debugger Apply iwyu suggestion in core. 2024-12-19 00:43:47 +08:00
error Fix race conditions in breadcrumbs 2024-10-22 22:08:46 -03:00
extension Merge pull request #100622 from dsnopek/gdextension-compat-hashes 2024-12-20 23:57:02 +01:00
input Merge pull request #100564 from YYF233333/iwyu 2024-12-19 19:59:55 -06:00
io Merge pull request #100564 from YYF233333/iwyu 2024-12-19 19:59:55 -06:00
math Merge pull request #100659 from clayjohn/color-srgb-precision 2024-12-20 23:57:35 +01:00
object Merge pull request #100564 from YYF233333/iwyu 2024-12-19 19:59:55 -06:00
os Merge pull request #99010 from Hilderin/embedding-game-process 2024-12-20 23:56:43 +01:00
string Merge pull request #100434 from Ivorforce/string-copy-from-rename 2024-12-19 19:59:57 -06:00
templates Refactor CommandQueueMT to use vararg templates 2025-01-02 15:35:08 +01:00
variant Merge pull request #100582 from bruvzg/fix_in_ops 2024-12-19 20:00:06 -06:00
SCsub SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
core_bind.compat.inc [OS] Add functions to determine standard I/O device type. 2024-11-06 13:33:38 +02:00
core_bind.cpp Merge pull request #99010 from Hilderin/embedding-game-process 2024-12-20 23:56:43 +01:00
core_bind.h Merge pull request #99010 from Hilderin/embedding-game-process 2024-12-20 23:56:43 +01:00
core_builders.py Update pre-commit hooks configuration to use `ruff` instead of `black` 2024-05-21 18:02:29 -05:00
core_constants.cpp Apply iwyu suggestion in core. 2024-12-19 00:43:47 +08:00
core_constants.h Apply iwyu suggestion in core. 2024-12-19 00:43:47 +08:00
core_globals.cpp
core_globals.h
core_string_names.h Move singleton StringName definitions to header 2024-12-06 13:43:31 +01:00
doc_data.cpp Code Editor: Add documentation tooltips 2024-12-15 10:51:33 +03:00
doc_data.h Code Editor: Add documentation tooltips 2024-12-15 10:51:33 +03:00
register_core_types.cpp Apply iwyu suggestion in core. 2024-12-19 00:43:47 +08:00
register_core_types.h Register Engine, OS, ProjectSettings, and Time early. 2024-11-21 18:09:03 -05:00
typedefs.h Optimize `SWAP` macro by using move semantics. 2024-12-13 16:19:52 +01:00
version.h Display the build date in the editor and when starting the engine 2024-02-27 20:39:17 +01:00