mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Add aggregate initialization
This commit is contained in:
parent
be15f69522
commit
2aebaf5abb
9 changed files with 139 additions and 36 deletions
|
|
@ -325,4 +325,41 @@ BENCH("cleanup gc removal", function()
|
|||
vide.step(0) -- cleanup from previous benchmark
|
||||
end)
|
||||
|
||||
|
||||
do
|
||||
-- the purpose of the two following benchmarks is to measure the overhead of
|
||||
-- aggregate construction
|
||||
BENCH("set explicit mock vector2", function()
|
||||
local create = vide.create
|
||||
local apply = require "src/apply"
|
||||
local Vector2 = require "test/mock".Vector2
|
||||
|
||||
local label = create "TextLabel" {
|
||||
AnchorPoint = Vector2.new(1, 1)
|
||||
}
|
||||
|
||||
for i = 1, START(N) do
|
||||
apply(label, {
|
||||
AnchorPoint = Vector2.new(i, i)
|
||||
})
|
||||
end
|
||||
end)
|
||||
|
||||
BENCH("set aggregate mock vector2", function()
|
||||
local create = vide.create
|
||||
local apply = require "src/apply"
|
||||
local Vector2 = require "test/mock".Vector2
|
||||
|
||||
local label = create "TextLabel" {
|
||||
AnchorPoint = Vector2.new(1, 1)
|
||||
}
|
||||
|
||||
for i = 1, START(N) do
|
||||
apply(label, {
|
||||
AnchorPoint = { i, i }
|
||||
})
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue