Giter Club home page Giter Club logo

Comments (5)

AntonYudintsev avatar AntonYudintsev commented on May 29, 2024

Interesting, will take a look there.
On clang/windows it is 10 times smaller.

from dascript.

AntonYudintsev avatar AntonYudintsev commented on May 29, 2024

Thank you for that Issue.
We have already found several configuration settings that result in both executable size and performance degradations (such as asserts left in release build!).
We have managed to decrease size to 34mb, just by that alone (already in master).

It is also possible to further significantly decrease size, if in CMakeCommon.txt you will go for:
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -fno-rtti -fno-exceptions -fomit-frame-pointer -fno-stack-protector -s -DDAS_FUSION=1")

and if you replace "-O3" with "-Os" size drops to 23mb (~-30%) and difference in performance in interpretation is almost zero (of course, c++ or AOT code performance can and will change, especially in loops). It is possible to generate code with different settings for interpretation and AOT files, but we leave this to application integration.

Even further, if you replace -DDAS_FUSION=1 with -DDAS_FUSION=0 size becames 12mb (yet another 50%), with a cost of switching off fusion engine. Which wont affect performance of AOT, but can affect interpretation performance. We have not investigate performance impact, and it can vary from test to test.

The total size is still 12MB, which is more than twice higher than size of executable binaries in Windows, so may be it worth looking into even further, but as for today I think it is kinda enough :)

Additionally, if you enable LTO you can shave off couple of megabytes and get some performance, but link time will become insanely high on gcc.

Hope that settles the issue.

from dascript.

onehundredfeet avatar onehundredfeet commented on May 29, 2024

lib
My Experiments on Mac OSX 10.15, Xcode 12
Default Release size: 36.7M
Dead Code Stripping: 35..9M
Change to "-Os" : 32.6
-DDAS_FUSION=0 : 18.8 (I have serious concerns about using this option)
running strip daScript 11.5M. (Tons of symbol data not stripped during link)

For comparison. all of SDL is 1.5M. I don't really understand why the compiler is inflating the size so far.

from dascript.

AntonYudintsev avatar AntonYudintsev commented on May 29, 2024

With recent optimizations and compiler fixes, the size of code has been reduced 2-4 times (that also resulted in compile time reduction). Further optimizations are possible, but provides diminishing returns.
So, I am closing the issue, thank you for your feedback.

from dascript.

onehundredfeet avatar onehundredfeet commented on May 29, 2024

from dascript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.