Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convertSubChunk* accept std::function(uint8_t, uint8_t) which puts an unnecessary performance burden on the converter #16

Closed
dktapps opened this issue Sep 13, 2020 · 1 comment

Comments

@dktapps
Copy link
Member

dktapps commented Sep 13, 2020

The conversion has to merge the id/meta into a single number in order to find unique entries. However, this results in it having to take the number apart again in order to pass it to the mapper, which is currently always flattenData, which promptly proceeds to just put it straight back together again. Since the mapper isn't currently inlined, the compiler can't optimise away this useless crap which adds extra overhead.

https://github.com/pmmp/ext-chunkutils2/blob/master/lib/SubChunkConverter.h#L45-L46
https://github.com/pmmp/ext-chunkutils2/blob/master/src/PhpSubChunkConverter.cpp#L14

@dktapps
Copy link
Member Author

dktapps commented Sep 13, 2020

As of 0cad64e, these are now able to be inlined, so the performance hit is reduced.

@dktapps dktapps closed this as completed Sep 21, 2020
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

No branches or pull requests

1 participant