Skip to content

Commit b81f108

Browse files
committed
Add performance tracing to ecs_query_init
1 parent 60c5290 commit b81f108

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

distr/flecs.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34296,6 +34296,8 @@ ecs_query_t* ecs_query_init(
3429634296
ecs_world_t *world,
3429734297
const ecs_query_desc_t *const_desc)
3429834298
{
34299+
ecs_os_perf_trace_push("flecs.query_init");
34300+
3429934301
ecs_world_t *world_arg = world;
3430034302
ecs_stage_t *stage = flecs_stage_from_world(&world);
3430134303

@@ -34367,10 +34369,15 @@ ecs_query_t* ecs_query_init(
3436734369
flecs_poly_modified(world, entity, ecs_query_t);
3436834370
}
3436934371

34372+
ecs_os_perf_trace_pop("flecs.query_init");
34373+
3437034374
return &result->pub;
3437134375
error:
3437234376
result->pub.entity = 0;
3437334377
ecs_query_fini(&result->pub);
34378+
34379+
ecs_os_perf_trace_pop("flecs.query_init");
34380+
3437434381
return NULL;
3437534382
}
3437634383

src/query/api.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ ecs_query_t* ecs_query_init(
375375
ecs_world_t *world,
376376
const ecs_query_desc_t *const_desc)
377377
{
378+
ecs_os_perf_trace_push("flecs.query_init");
379+
378380
ecs_world_t *world_arg = world;
379381
ecs_stage_t *stage = flecs_stage_from_world(&world);
380382

@@ -446,10 +448,15 @@ ecs_query_t* ecs_query_init(
446448
flecs_poly_modified(world, entity, ecs_query_t);
447449
}
448450

451+
ecs_os_perf_trace_pop("flecs.query_init");
452+
449453
return &result->pub;
450454
error:
451455
result->pub.entity = 0;
452456
ecs_query_fini(&result->pub);
457+
458+
ecs_os_perf_trace_pop("flecs.query_init");
459+
453460
return NULL;
454461
}
455462

0 commit comments

Comments
 (0)