Skip to content

Commit 052b4d4

Browse files
authored
Merge pull request #11142 from beicause/patch-1
Improve descriptions of `LocalVector`, recommend it when appropriate
2 parents bbb393c + 4502192 commit 052b4d4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

engine_details/architecture/core_types.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ scripting API.
146146
+-----------------------+--------------------------+---------------------------------------------------------------------------------------+
147147
| |vector| | ``std::vector`` | **Use this as the "default" vector type.** Uses copy-on-write (COW) semantics. |
148148
| | | This means it's generally slower but can be copied around almost for free. |
149+
| | | Use ``LocalVector`` instead where COW isn't needed and performance matters. |
149150
+-----------------------+--------------------------+---------------------------------------------------------------------------------------+
150151
| |hash_set| | ``std::unordered_set`` | **Use this as the "default" set type.** |
151152
+-----------------------+--------------------------+---------------------------------------------------------------------------------------+
@@ -156,8 +157,9 @@ scripting API.
156157
| |string_name| 📜 | ``std::string`` | Uses string interning for fast comparisons. Use this for static strings that are |
157158
| | | referenced frequently and used in multiple locations in the engine. |
158159
+-----------------------+--------------------------+---------------------------------------------------------------------------------------+
159-
| |local_vector| | ``std::vector`` | Closer to ``std::vector`` in semantics. In most situations, ``Vector`` should be |
160-
| | | preferred. |
160+
| |local_vector| | ``std::vector`` | Closer to ``std::vector`` in semantics, doesn't use copy-on-write (COW) thus it's |
161+
| | | faster than ``Vector``. Prefer it over ``Vector`` when copying it cheaply |
162+
| | | is not needed. |
161163
+-----------------------+--------------------------+---------------------------------------------------------------------------------------+
162164
| |array| 📜 | ``std::vector`` | Values can be of any Variant type. No static typing is imposed. |
163165
| | | Uses shared reference counting, similar to ``std::shared_ptr``. |

0 commit comments

Comments
 (0)