-
Notifications
You must be signed in to change notification settings - Fork 149
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
C2MIR high memory usage when executing sqlite3 #411
Comments
i'd say for a fair comparison you should compare the execution of the pre-compiled bytecode, or conversely the compilation of sqlite3.c with gcc plus the sqlite execution vs your existing c2m test. |
For comparison I've tested build with other compilers:
build-sqlite3.sh
|
Building and running together:
|
Also building with https://github.com/johnsonjh/pcc-revived/tree/johnsonjh/rawhide :
|
Also building with https://github.com/stormalf/chibicc :
|
I'm measuring thousands of heap allocations for a simple 2-line C function using c2mir. I'm also having problem resetting it afterwards. I don't mind the usage, but there doesn't seem to be a graceful way to reset at all. After compiling using c2mir the second time it grows beyond 4000 heap allocations. No amount of MIR_*_finish that I have tried has been able to reduce the number of heap allocations back to less than 4000. I hope I'm not "hijacking" the wrong thread here. I saw that this had to do with memory usage. If so, I can create a new issue instead. |
I think we can conclude my comment: It's because Mir doesn't clean up if compilation fails with c2mir. If compilation succeeds, you can compile again. Memory usage and cleanup is a real problem, but less so on the happy path. |
Testing
c2mir
withsqlite3
after minor fixes (see bellow) I'm getting this results:Native
sqlite3
:c2mir
sqlite3
:run-sqlite3.sh
:Fixes for
sqlite3.c
:Fixes for
shell.c
:The text was updated successfully, but these errors were encountered: