mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Vector: Use TypedTransfer in more parts of Vector
Make more Vector-of-trivial-type operations go fast :^)
This commit is contained in:
parent
e8e85f5457
commit
6da6ca64d2
2 changed files with 24 additions and 9 deletions
|
@ -167,4 +167,18 @@ TEST_CASE(vector_compare)
|
|||
EXPECT_EQ(strings, same_strings);
|
||||
}
|
||||
|
||||
BENCHMARK_CASE(vector_append_trivial)
|
||||
{
|
||||
// This should be super fast thanks to Vector using memmove.
|
||||
Vector<int> ints;
|
||||
for (int i = 0; i < 1000000; ++i) {
|
||||
ints.append(i);
|
||||
}
|
||||
for (int i = 0; i < 100; ++i) {
|
||||
Vector<int> tmp;
|
||||
tmp.append(ints);
|
||||
EXPECT_EQ(tmp.size(), 1000000);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_MAIN(Vector)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue