Closed aismann closed 2 years ago
Good job! this would improve mesh generation speed since vertices get added with emplace_back
rather than push_back
I like it! it would be cool if IndexArray
gets this change too, but I fear that POD-like (plain old data)
data (i.e. floats, integers, chars)
don't get this boost because they are not constructed or rather they are simple types, unlike a custom type the user created. I really don't know
The difference in the efficiency of push_back and emplace_back depends on the type of our vector. If the vector is a built-in type, there is no difference between the efficiency of push_back and emplace_back. If the vector type is class or struct, emplace_back is more efficient than push_back.
Oh! sorry I didn't read that part there!
Should we change it?
do you mean the Vector
class with an uppercase V that holds references? if not then what array class exactly?
keep in mind that users will not adapt to this change and will instead use the default insertion method.
do you mean the
Vector
class with an uppercase V that holds references? if not then what array class exactly?keep in mind that users will not adapt to this change and will instead use the default insertion method.
We change the axis engine. What users doing on here own sources is not the goal of this issue. I belive evey repace is a good idea on the axis engine sources
Have axis some tests which can show a performance boost?
We change the axis engine. What users doing on here own sources is not the goal of this issue. I belive evey repace is a good idea on the axis engine sources
yeah you're right, should always consider that!
Replace push_back() vs emplace_back() on axis\core\ #781
old: push_back: new: emplace_back:
'extension' has also some potential: Which folder should be NOT changed?
The fiarygui, ImGui, Live2D, spine should be NOT changed
The fiarygui, ImGui, Live2D, spine should be NOT changed
What about DragonBones? Can be adapt?
You aslo can skip DragonBones
since it stop maintenance 4 years.
Can be closed after merge of #785.
with the extensions i got some more sprites:
push_back and emplace_back in C++ Push_back: Push_back adds a new element at the end. It first creates a temporary object by calling a constructor.
Emplace_back: It also Inserts a new element at the end. It does not create a temporary object. The object is directly created in the vector. Due to this, the efficiency is increased.
The difference in the efficiency of push_back and emplace_back depends on the type of our vector. If the vector is a built-in type, there is no difference between the efficiency of push_back and emplace_back. If the vector type is class or struct, emplace_back is more efficient than push_back.
see also: https://www.codingninjas.com/codestudio/library/vector-push_back-vs-emplace_back#:~:text=Push_back%3A%20Push_back%20adds%20a%20new%20element%20at%20the,vector.%20Due%20to%20this%2C%20the%20efficiency%20is%20increased.