You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am looking to decrease the size of executables generated with sol2 which map some C++ interfaces to Lua. I am currently limited to using C++14, therefore I am sticking with sol 2.20.1 for now.
After reading this issue: #295, I switched from new_usertype to new_simple_usertype when mapping usertypes. This decreased the size of the generated binary roughly by half in my tests (from ~1 Mb to 500 Kb for 10 usertypes with 10 functions each), which is right at the target I have.
The documentation of the 2.21.1 version no longer documents new_simple_usertype, although the function is still in the API.
I saw that simple_usertype type is removed fully in sol3 (#776), stating that the compilation and runtime is better with new_usertype implementation. Unfortunately my tests show that the executable size does not decrease with sol3 new_usertype to the same levels as with the old new_simple_usertype.
So far I have tested the generated executable size with a few versions of gcc and clang, with O2, O3 and Os flags. O3 in my tests generates slightly smaller executables. O0 the largest by a factor of 5.
Do you have any additional advice to decrease significantly the executable size using sol with 2.20.1, 3.x and maybe how the binary size of the future sol4 would be?
Is there a particular reason not to use the new_simple_usertype from 2.20.1, as it no longer is documented?
Thank you!
The text was updated successfully, but these errors were encountered:
Hi,
I am looking to decrease the size of executables generated with sol2 which map some C++ interfaces to Lua. I am currently limited to using C++14, therefore I am sticking with sol 2.20.1 for now.
After reading this issue: #295, I switched from
new_usertype
tonew_simple_usertype
when mapping usertypes. This decreased the size of the generated binary roughly by half in my tests (from ~1 Mb to 500 Kb for 10 usertypes with 10 functions each), which is right at the target I have.The documentation of the 2.21.1 version no longer documents
new_simple_usertype
, although the function is still in the API.I saw that
simple_usertype
type is removed fully in sol3 (#776), stating that the compilation and runtime is better withnew_usertype
implementation. Unfortunately my tests show that the executable size does not decrease with sol3new_usertype
to the same levels as with the oldnew_simple_usertype
.So far I have tested the generated executable size with a few versions of gcc and clang, with O2, O3 and Os flags. O3 in my tests generates slightly smaller executables. O0 the largest by a factor of 5.
Do you have any additional advice to decrease significantly the executable size using sol with 2.20.1, 3.x and maybe how the binary size of the future sol4 would be?
Is there a particular reason not to use the
new_simple_usertype
from 2.20.1, as it no longer is documented?Thank you!
The text was updated successfully, but these errors were encountered: