About Monkey 2 › Forums › Monkey 2 Development › Large EXE size?
This topic contains 3 replies, has 3 voices, and was last updated by
therevills 2 years, 10 months ago.
-
AuthorPosts
-
June 7, 2016 at 10:35 pm #951
Just seeing the sizes of the EXE once a MX2 app has compiled on Windows:
[/crayon]Monkey123[crayon-5cb9b8031fe29940613644 inline="true" ]Function Main()Print "HELLO"EndDebug EXE: 415KB
Release EXE: 203KB[/crayon]Monkey123456789101112131415161718192021222324252627282930313233343536373839[crayon-5cb9b8031fe2e089565885 inline="true" ]Namespace supergame#Import "<std>"#Import "<mojo>"#Import "assets/spaceship_32.png"Using std..Using mojo..Class MyWindow Extends WindowField image:ImageMethod New(title:String, width:Int,height:Int)Super.New(title, width, height, WindowFlags.Resizable)ClearColor = Color.BlackSwapInterval=1LoadStuff()EndMethod LoadStuff()image = Image.Load( "asset::spaceship_32.png" )image.Handle=New Vec2f( .5,.5 )EndMethod OnRender(canvas:Canvas) OverrideApp.RequestRender()canvas.Color = New Color(.5, .5, .5)canvas.DrawText("Hello World!", 320, 240, .5, .5)canvas.Color = New Color(1, 1, 1)canvas.DrawImage(image, 100, 100)EndEndFunction Main()New AppInstanceNew MyWindow( "Super Game!",App.DesktopSize.x/2,App.DesktopSize.y/2 )App.Run()EndDebug EXE: 7235KB (plus DLLs)
Release EXE: 3149KB (plus DLLs)I know its a new tech, but these EXE sizes look a bit on the large size for these small code samples.
Is there a plan for the future to reduce the size of the EXEs?
June 8, 2016 at 12:24 am #955There is probably some scope for reducing exe sizes – you could rebuild everything in release mode optimized for size instead of speed for example – but I can’t see it making a huge difference and I wont be doing this by default.
Much of the size will be a ‘one off’ hit, eg: the mingw static libs and SDL etc. Adding code shouldn’t blow things up tooo dramatically.
Creating a self extracting exe of ‘spacechimps’ gives me a 2M exe with I’m OK with.
June 8, 2016 at 12:25 am #956I’m not near a computer with M2, but if I remember well the majority of the file size is coming from Mojo, if you only include Std it should drop quite a lot.
My guess is that, unlike M1, M2 compiles everything from the source files, even if it’s unused. Makes sense, since the modules are “pre-compiled” (forgive me if I don’t use the correct terms). Seems like the upside is that M2 compiles much, much, much faster than M1 when creating desktop apps.
But I agree, in the long term it would be ideal if some sort of “unused code stripping” becomes available, even if it comes with the price of slower compiling. Maybe we could have “release”, “debug” and “light” builds, light being slower to compile since it would recompile each used module with just the parts of the code actually used.
I imagine that would be very helpful for Emscripten builds, possibly lowering the download time significantly.
June 8, 2016 at 1:01 am #962We’ll have to test a really large project and see if the size goes up too much.
I’m loving the current speed of MX2 compile times
(Oh BTW I’ve noticed that the “CODE” tag now expands double quotes)
-
AuthorPosts
You must be logged in to reply to this topic.