mirror of
https://github.com/godotengine/godot-benchmarks.git
synced 2026-01-06 14:10:20 +03:00
Resave all scenes and scripts on Godot 4.4.dev5, fix GDScript warnings
This will avoid large diffs later on. This also fixes GDScript warnings across the codebase.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
extends Benchmark
|
||||
|
||||
@warning_ignore("unused_signal")
|
||||
signal emitter
|
||||
|
||||
const ITERATIONS = 2_000_000
|
||||
|
||||
1
benchmarks/core/callable.gd.uid
Normal file
1
benchmarks/core/callable.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cifqwer4fclqm
|
||||
@@ -35,4 +35,3 @@ func benchmark_save_with_password() -> void:
|
||||
func benchmark_load_with_password() -> void:
|
||||
for i in ITERATIONS:
|
||||
config.load_encrypted_pass(CONFIG_FILE_ENCRYPTED, "PasswordIsGodot")
|
||||
|
||||
|
||||
1
benchmarks/core/config_file.gd.uid
Normal file
1
benchmarks/core/config_file.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dv1wr8spnp4v4
|
||||
@@ -6,12 +6,14 @@ const BYTES = 1_000_000_000
|
||||
var crypto := Crypto.new()
|
||||
|
||||
func benchmark_generate_1m_random_bytes_10_at_a_time() -> void:
|
||||
@warning_ignore("integer_division")
|
||||
var iterations = BYTES_SMALL / 10
|
||||
for i in iterations:
|
||||
crypto.generate_random_bytes(10)
|
||||
|
||||
|
||||
func benchmark_generate_1g_random_bytes_1k_at_a_time() -> void:
|
||||
@warning_ignore("integer_division")
|
||||
var iterations = BYTES / 1000
|
||||
for i in iterations:
|
||||
crypto.generate_random_bytes(1000)
|
||||
|
||||
1
benchmarks/core/crypto.gd.uid
Normal file
1
benchmarks/core/crypto.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dyaiap76qxtk1
|
||||
@@ -7,38 +7,37 @@ var threads: Array[Thread]
|
||||
var sem := Semaphore.new()
|
||||
|
||||
func _init_threads(p_count: int, p_contention_min: float = 1.0, p_contention_max: float = 1.0):
|
||||
var contention := p_contention_max
|
||||
for i in p_count:
|
||||
var th := Thread.new()
|
||||
var duty: float
|
||||
if i == 0:
|
||||
duty = 1.0
|
||||
else:
|
||||
# Min is never reached, so 0 can be used without the last thread having 0 duties.
|
||||
duty = remap(i + 1, 0, p_count, p_contention_min, p_contention_max)
|
||||
th.start(_thread_func.bind(duty))
|
||||
threads.push_back(th)
|
||||
sem.post(threads.size())
|
||||
for i in p_count:
|
||||
var th := Thread.new()
|
||||
var duty: float
|
||||
if i == 0:
|
||||
duty = 1.0
|
||||
else:
|
||||
# Min is never reached, so 0 can be used without the last thread having 0 duties.
|
||||
duty = remap(i + 1, 0, p_count, p_contention_min, p_contention_max)
|
||||
th.start(_thread_func.bind(duty))
|
||||
threads.push_back(th)
|
||||
sem.post(threads.size())
|
||||
|
||||
func _term_threads():
|
||||
for th in threads:
|
||||
th.wait_to_finish()
|
||||
threads = []
|
||||
for th in threads:
|
||||
th.wait_to_finish()
|
||||
threads = []
|
||||
|
||||
func _thread_func(p_duty: float) -> void:
|
||||
var objs: Array[Object]
|
||||
objs.resize(NUM_OBJECTS)
|
||||
sem.wait()
|
||||
for i in int(ITERATIONS * p_duty):
|
||||
for j in NUM_OBJECTS:
|
||||
objs[j] = Object.new()
|
||||
for j in NUM_OBJECTS:
|
||||
objs[j].free()
|
||||
var objs: Array[Object]
|
||||
objs.resize(NUM_OBJECTS)
|
||||
sem.wait()
|
||||
for i in int(ITERATIONS * p_duty):
|
||||
for j in NUM_OBJECTS:
|
||||
objs[j] = Object.new()
|
||||
for j in NUM_OBJECTS:
|
||||
objs[j].free()
|
||||
|
||||
|
||||
func benchmark_single() -> void:
|
||||
_init_threads(1)
|
||||
_term_threads()
|
||||
_init_threads(1)
|
||||
_term_threads()
|
||||
|
||||
|
||||
# In the benchmarks below, different contention terms are used:
|
||||
@@ -50,64 +49,64 @@ func benchmark_single() -> void:
|
||||
# little - Threads other than the first one run few iterations.
|
||||
|
||||
func benchmark_2_threads_full_contention() -> void:
|
||||
_init_threads(2)
|
||||
_term_threads()
|
||||
_init_threads(2)
|
||||
_term_threads()
|
||||
|
||||
func benchmark_2_threads_half_contention() -> void:
|
||||
_init_threads(2, 0.5, 0.5)
|
||||
_term_threads()
|
||||
_init_threads(2, 0.5, 0.5)
|
||||
_term_threads()
|
||||
|
||||
func benchmark_2_threads_little_contention() -> void:
|
||||
_init_threads(2, 0.1, 0.1)
|
||||
_term_threads()
|
||||
_init_threads(2, 0.1, 0.1)
|
||||
_term_threads()
|
||||
|
||||
|
||||
func benchmark_4_threads_full_contention() -> void:
|
||||
_init_threads(4)
|
||||
_term_threads()
|
||||
_init_threads(4)
|
||||
_term_threads()
|
||||
|
||||
func benchmark_4_threads_half_contention() -> void:
|
||||
_init_threads(4, 0.5, 0.5)
|
||||
_term_threads()
|
||||
_init_threads(4, 0.5, 0.5)
|
||||
_term_threads()
|
||||
|
||||
func benchmark_4_threads_slope_contention() -> void:
|
||||
_init_threads(4, 0.0, 1.0)
|
||||
_term_threads()
|
||||
_init_threads(4, 0.0, 1.0)
|
||||
_term_threads()
|
||||
|
||||
func benchmark_4_threads_little_contention() -> void:
|
||||
_init_threads(4, 0.1, 0.1)
|
||||
_term_threads()
|
||||
_init_threads(4, 0.1, 0.1)
|
||||
_term_threads()
|
||||
|
||||
|
||||
func benchmark_8_threads_full_contention() -> void:
|
||||
_init_threads(8)
|
||||
_term_threads()
|
||||
_init_threads(8)
|
||||
_term_threads()
|
||||
|
||||
func benchmark_8_threads_half_contention() -> void:
|
||||
_init_threads(8, 0.5, 0.5)
|
||||
_term_threads()
|
||||
_init_threads(8, 0.5, 0.5)
|
||||
_term_threads()
|
||||
|
||||
func benchmark_8_threads_slope_contention() -> void:
|
||||
_init_threads(8, 0.0, 1.0)
|
||||
_term_threads()
|
||||
_init_threads(8, 0.0, 1.0)
|
||||
_term_threads()
|
||||
|
||||
func benchmark_8_threads_little_contention() -> void:
|
||||
_init_threads(8, 0.1, 0.1)
|
||||
_term_threads()
|
||||
_init_threads(8, 0.1, 0.1)
|
||||
_term_threads()
|
||||
|
||||
|
||||
func benchmark_12_threads_full_contention() -> void:
|
||||
_init_threads(12)
|
||||
_term_threads()
|
||||
_init_threads(12)
|
||||
_term_threads()
|
||||
|
||||
func benchmark_12_threads_half_contention() -> void:
|
||||
_init_threads(12, 0.5, 0.5)
|
||||
_term_threads()
|
||||
_init_threads(12, 0.5, 0.5)
|
||||
_term_threads()
|
||||
|
||||
func benchmark_12_threads_slope_contention() -> void:
|
||||
_init_threads(12, 0.0, 1.0)
|
||||
_term_threads()
|
||||
_init_threads(12, 0.0, 1.0)
|
||||
_term_threads()
|
||||
|
||||
func benchmark_12_threads_little_contention() -> void:
|
||||
_init_threads(12, 0.1, 0.1)
|
||||
_term_threads()
|
||||
_init_threads(12, 0.1, 0.1)
|
||||
_term_threads()
|
||||
|
||||
1
benchmarks/core/object_db.gd.uid
Normal file
1
benchmarks/core/object_db.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d3ddxos0exsy
|
||||
@@ -3,4 +3,4 @@ extends Benchmark
|
||||
# An empty test, to act as a control
|
||||
|
||||
func benchmark_control():
|
||||
pass
|
||||
pass
|
||||
|
||||
1
benchmarks/gdscript/control.gd.uid
Normal file
1
benchmarks/gdscript/control.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://p5tfytfckmj0
|
||||
@@ -9,6 +9,7 @@ const MAX_ITERATION := 1000
|
||||
# Licensed under MIT
|
||||
func hsv(hue: float, sat: float, value: float) -> Color:
|
||||
hue = fposmod(hue, 360.0)
|
||||
@warning_ignore("integer_division")
|
||||
var h := floori(hue) / 60
|
||||
var f := hue / 60.0 - h
|
||||
var p := value * (1.0 - sat)
|
||||
|
||||
1
benchmarks/gdscript/mandelbrot_set.gd.uid
Normal file
1
benchmarks/gdscript/mandelbrot_set.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://tqgy273cqwwe
|
||||
@@ -27,11 +27,11 @@ func mesh_with_vertices(vertices: PackedVector3Array) -> Mesh:
|
||||
|
||||
return arr_mesh
|
||||
|
||||
func _bench_convex(clean: bool, simplify: bool) -> void:
|
||||
func _bench_convex(_clean: bool, simplify: bool) -> void:
|
||||
for i in NUM_ITERATIONS:
|
||||
var points := generate_point_cloud(CLOUD_SIZE, NUM_POINTS, POSITION)
|
||||
var mesh := mesh_with_vertices(points)
|
||||
var convex := mesh.create_convex_shape(clean, simplify)
|
||||
var _convex := mesh.create_convex_shape(_clean, simplify)
|
||||
|
||||
func benchmark_both_clean_and_simplify() -> void:
|
||||
return _bench_convex(true, true)
|
||||
|
||||
1
benchmarks/math/convex_hull_3d.gd.uid
Normal file
1
benchmarks/math/convex_hull_3d.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c4jcx0xb3b2lb
|
||||
@@ -41,7 +41,7 @@ func _parse_all(strs):
|
||||
var rv = []
|
||||
for s in strs:
|
||||
var expr = Expression.new()
|
||||
var err = expr.parse(s, _var_names())
|
||||
var _err = expr.parse(s, _var_names())
|
||||
rv.append(expr)
|
||||
return rv
|
||||
|
||||
@@ -54,11 +54,11 @@ func _execute_all(exprs):
|
||||
|
||||
func benchmark_parse_20_complex_expressions_cold():
|
||||
var strs = EXPRESSIONS
|
||||
var exprs = _parse_all(strs)
|
||||
var _exprs = _parse_all(strs)
|
||||
|
||||
func benchmark_parse_20_complex_expressions_with_cached_parse():
|
||||
var strs = EXPRESSIONS
|
||||
var exprs = _parse_all(strs)
|
||||
var _exprs = _parse_all(strs)
|
||||
|
||||
func benchmark_parse_20_complex_expressions_with_cached_parse_then_execute():
|
||||
var strs = EXPRESSIONS
|
||||
|
||||
1
benchmarks/math/expression.gd.uid
Normal file
1
benchmarks/math/expression.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d3wjqqoskbisn
|
||||
@@ -28,6 +28,7 @@ class TestScene:
|
||||
func _draw() -> void:
|
||||
for i in shape_amount:
|
||||
var x := (i * 20) % window_size.x
|
||||
@warning_ignore("integer_division")
|
||||
var y := (i * 200) / window_size.x
|
||||
var center := Vector2(x, y)
|
||||
var remainder := i % 5
|
||||
|
||||
1
benchmarks/rendering/canvas_item.gd.uid
Normal file
1
benchmarks/rendering/canvas_item.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bs3a2dlqf044h
|
||||
@@ -137,4 +137,3 @@ func benchmark_aaa_setup():
|
||||
var tmp := Node3D.new()
|
||||
attach_model_recursive(tmp, NUMBER_OF_OBJECTS)
|
||||
tmp.free()
|
||||
|
||||
|
||||
1
benchmarks/rendering/hlod.gd.uid
Normal file
1
benchmarks/rendering/hlod.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://js2fd3mb3ty
|
||||
@@ -34,6 +34,7 @@ class TestScene:
|
||||
CylinderMesh.new(),
|
||||
PrismMesh.new(),
|
||||
]
|
||||
@warning_ignore("integer_division")
|
||||
var half_objects := NUMBER_OF_OBJECTS / 2
|
||||
for i in NUMBER_OF_OBJECTS:
|
||||
var ins := MeshInstance3D.new()
|
||||
|
||||
1
benchmarks/rendering/lightmap_probe_influence.gd.uid
Normal file
1
benchmarks/rendering/lightmap_probe_influence.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bsue6um7t1nsu
|
||||
@@ -152,4 +152,3 @@ func benchmark_speed_slow() -> Node3D:
|
||||
|
||||
func benchmark_stress() -> Node3D:
|
||||
return create_scene({mesh=sphere_mesh,objects=10000,lights=100,speed=5.0})
|
||||
|
||||
|
||||
1
benchmarks/rendering/lights_and_meshes.gd.uid
Normal file
1
benchmarks/rendering/lights_and_meshes.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d188s4dxj6v3v
|
||||
@@ -15,7 +15,7 @@ class Test2DParticles extends Node2D:
|
||||
var nodes: int = 1
|
||||
var particles: int = 1
|
||||
var type := ParticleType.GPU_PARTICLES
|
||||
|
||||
|
||||
func _init(settings: Dictionary) -> void:
|
||||
type = settings.get("type")
|
||||
nodes = settings.get("nodes")
|
||||
@@ -34,7 +34,7 @@ class Test2DParticles extends Node2D:
|
||||
node = cpu_node
|
||||
node.position = Vector2(randf_range(-x, x), randf_range(-y, y))
|
||||
add_child(node)
|
||||
|
||||
|
||||
func create_particles(node) -> Node2D:
|
||||
node.process_material = ParticleProcessMaterial.new()
|
||||
node.process_material.spread = 180
|
||||
@@ -59,12 +59,12 @@ class Test2DParticles extends Node2D:
|
||||
|
||||
func benchmark_few_gpuparticles2d_nodes_with_many_particles() -> Node2D:
|
||||
return Test2DParticles.new({type = ParticleType.GPU_PARTICLES, nodes = 100, particles = 1000})
|
||||
|
||||
|
||||
func benchmark_many_gpuparticles2d_nodes_with_few_particles() -> Node2D:
|
||||
return Test2DParticles.new({type = ParticleType.GPU_PARTICLES, nodes = 1000, particles = 100})
|
||||
|
||||
|
||||
func benchmark_few_cpuparticles2d_nodes_with_many_particles() -> Node2D:
|
||||
return Test2DParticles.new({type = ParticleType.CPU_PARTICLES, nodes = 100, particles = 1000})
|
||||
|
||||
|
||||
func benchmark_many_cpuparticles2d_nodes_with_few_particles() -> Node2D:
|
||||
return Test2DParticles.new({type = ParticleType.CPU_PARTICLES, nodes = 1000, particles = 100})
|
||||
|
||||
1
benchmarks/rendering/particles_2d.gd.uid
Normal file
1
benchmarks/rendering/particles_2d.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b6amyba7k40pl
|
||||
@@ -66,5 +66,3 @@ func benchmark_500_sprite_2d():
|
||||
return TestSprite.new(500)
|
||||
func benchmark_5000_sprite_2d():
|
||||
return TestSprite.new(5000)
|
||||
|
||||
|
||||
|
||||
1
benchmarks/rendering/polygon_sprite_2d.gd.uid
Normal file
1
benchmarks/rendering/polygon_sprite_2d.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dymfgnww3lkj3
|
||||
@@ -34,7 +34,7 @@ class TestScene extends Node3D:
|
||||
$VeryLargeScene/Camera3D.environment = env
|
||||
add_child(world_env)
|
||||
|
||||
func _process(delta):
|
||||
func _process(_delta):
|
||||
pass
|
||||
|
||||
func _exit_tree():
|
||||
|
||||
1
benchmarks/rendering/sdfgi.gd.uid
Normal file
1
benchmarks/rendering/sdfgi.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dm3d7gx4qmk7w
|
||||
@@ -17,7 +17,7 @@ func _init() -> void:
|
||||
var random_parent := nodes[randi() % nodes.size()]
|
||||
random_parent.add_child(new_node)
|
||||
nodes.push_back(new_node)
|
||||
|
||||
|
||||
for node in nodes:
|
||||
node_paths.push_back(root.get_path_to(node))
|
||||
|
||||
|
||||
1
benchmarks/scene_nodes/get_node.gd.uid
Normal file
1
benchmarks/scene_nodes/get_node.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c45vex4l035tr
|
||||
@@ -7,7 +7,7 @@ const ITERATIONS = 1_000
|
||||
var root: Node
|
||||
var children: Array[Node]
|
||||
|
||||
# Benchmark move_child by moving to random positions ITERATIONS
|
||||
# Benchmark move_child by moving to random positions ITERATIONS
|
||||
# children ITERATIONS times. The tree is created in init.
|
||||
|
||||
func _init() -> void:
|
||||
|
||||
1
benchmarks/scene_nodes/move_children.gd.uid
Normal file
1
benchmarks/scene_nodes/move_children.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://be270cy5ayr6v
|
||||
Reference in New Issue
Block a user