Skip to content

introduce safety info + ecs_get_id_from_record & refactor ecs_get_id methods to use it#1752

Closed
Indra-db wants to merge 10 commits into
SanderMertens:masterfrom
Indra-db:refactor-ecs_get_(mut_)id
Closed

introduce safety info + ecs_get_id_from_record & refactor ecs_get_id methods to use it#1752
Indra-db wants to merge 10 commits into
SanderMertens:masterfrom
Indra-db:refactor-ecs_get_(mut_)id

Conversation

@Indra-db
Copy link
Copy Markdown
Contributor

performance is unchanged according to the benchmarks, but remarkably sparse components get an unreasonable performance boost. I cannot seem to be able to explain it.

first column is without this commit, second column is with.

image image

@Indra-db
Copy link
Copy Markdown
Contributor Author

Indra-db commented Aug 17, 2025

I don't understand why CI for test windows is failing. The test is multithreaded enum registration.

could it be a fluke?

also see discord, I have some problems with bake.
https://discord.com/channels/633826290415435777/1406452408149741770/1406469611783979113

I also don't have a windows PC to further investigate it. Any advice?

@Indra-db
Copy link
Copy Markdown
Contributor Author

ok, seems like some fluke, CI passes

@Indra-db
Copy link
Copy Markdown
Contributor Author

Indra-db commented Sep 13, 2025

update to latest main + fix conflicts

Comment thread include/flecs/private/api_internals.h
Comment thread include/flecs/private/api_internals.h
Comment thread include/flecs.h
Comment thread src/commands.c
Comment thread include/flecs/private/api_internals.h
Comment thread src/entity.c
Comment thread src/entity.c
Comment thread src/entity.c

ecs_record_t *r = flecs_entities_get(world, entity);

return flecs_get_id_from_record(world, entity, r, component).component_ptr;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing ecs_get_id and ecs_get_mut_id means a lot more scrutiny has to be applied to this PR. This could cause performance regressions that depend on compiler-specific inlining behavior.

I'll need to test this myself, not sure if I'll have time for that before the next release but I'll try.

Comment thread src/entity.h
Comment thread src/entity.h
@SanderMertens
Copy link
Copy Markdown
Owner

Can you please merge this PR and #1753? By itself this PR doesn't make much sense. It introduces things called "safety" but there's no new functionality added that's safety related.

@Indra-db
Copy link
Copy Markdown
Contributor Author

merging this PR with #1753

@Indra-db Indra-db closed this Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants