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
[PoC] Reduce copy of C string to symbol in class, module and method definition. #4065
base: master
Are you sure you want to change the base?
Conversation
Have you measured how much memory (or object allocation) this patch reduced? |
config; https://gist.github.com/take-cheeze/36097cacd58bce1dd6ca2f430ceb9edf
|
Modification for |
Page faults are inaccurate and 30 minor page faults are less than 1.5% of total faults. |
3767b11
to
0260932
Compare
valgrind doesn't work well with fmt_fp.c so instead I used address sanitizer's stat: (ASAN_OPTIONS env var atexit enabled. And removed full-core since it is noisy.) malloc call is slightly less(10k decrease):
mmap is less too(about 10 maps):
|
I have read the patch:
|
At least in the core mrbgems I only need to modify mruby-struct for the API changes.
In some environment for example
can't be used. |
Since this is too big and breaks compatibility will split after reviews.
Most changes are to replace C function using
const char*
to macro and add_id
suffix to it.Some C function needs to have symbol for FFIs I've moved it to
mruby-symbol-ext
mrbgem.For checking the improment I've added a feature to see how many symbol is static.
It seems most symbol can be static on launched VM.