Improve profiling and fix perf issue

This commit is contained in:
Tuomas Katajisto 2025-07-20 22:24:54 +03:00
parent 9e76ba4c32
commit f6e754ff73
2 changed files with 14 additions and 21 deletions

View File

@ -37,6 +37,15 @@ draw_rectangle_prof :: (x0: float, y0: float, x1: float, y1: float, color: Vecto
draw_rectangle(r, color);
}
graph_begin :: (x: float, y: float, width: float, height: float) {
return;
}
graph_end :: (x: float, y: float, width: float, height: float) {
return;
}
iprof_cycle_active_report_mode :: () {
iprof_active_report_mode := __Iprof.displayed_quantity;
if iprof_active_report_mode == .SELF_TIME __Iprof.set_report_mode(.HIERARCHICAL_TIME);

View File

@ -344,27 +344,11 @@ a_is_inside_b :: (a: Quad, b: Quad) -> bool {
remove_quad :: (quad: Quad, quadSet: *Quad_Set) {
parent : Quad;
qlist : [..]Quad;
for k,v : quadSet {
array_add(*qlist, v);
}
Sort :: #import "Sort";
qcomp :: (a: Quad, b: Quad) -> s64 {
if a < b then return -1;
if b < a then return 1;
return 0;
}
Sort.bubble_sort(qlist, qcomp);
for qlist {
if it < quad then continue;
if a_is_inside_b(quad, it) {
parent = it;
table_remove(quadSet, it);
for v, k : quadSet {
if k < quad then continue;
if a_is_inside_b(quad, k) {
parent = k;
table_remove(quadSet, k);
break;
}
}