Thread overview
talk about dwt,jface executable size
May 24, 2008
yidabu
May 24, 2008
Frank Benoit
May 24, 2008
yidabu
May 24, 2008
torhu
May 24, 2008
John Reimer
May 24, 2008
torhu
May 24, 2008
John Reimer
May 24, 2008
dwt hello world size : 1.50 MB
jface hello world size: 2.52 MB

the size is not too big!
the main issue seems too long to build a static library by dsss, this may be a dsss issue.
I hope that dmd 1.031 will fix the anonymous classe bug and we can use the -lib build flag to build a static dwt lib, dwtx.lib

tested with dwt-win svn, dwt-addons svn, dmd 1.028
build dwt.lib and dwtx.lib by dsss 0.75
testd on Windows XP


dwt helloworld:

code:

import dwt.widgets.Display;
import dwt.widgets.Shell;
pragma(lib, "dwt.lib");
pragma(lib, "dwtx.lib");
void main ()
{
    auto display = new Display;
    auto shell = new Shell(display);
    shell.setText = "Hello DWT World ";
    shell.open;
    while (!shell.isDisposed)
        if (!display.readAndDispatch)
            display.sleep;

    display.dispose;
}

build command:

dmd test.d dwt.res -L/SUBSYSTEM:windows:5 -L/rc:dwt.res -J..\dwt-samples\res -J..\dwt-addons\res -release

executable size:
1.50 MB



Jface hello world

code:
import
    dwt.widgets.Display,
    dwt.widgets.Shell,
    dwt.DWT,
    dwt.widgets.Control,
    dwt.widgets.Composite,
    dwt.widgets.Label,
    dwtx.jface.window.ApplicationWindow;

public class MyWindow : ApplicationWindow
{
    this()
    {
        super(null);
    }
    void run()
    {
        setBlockOnOpen(true);
        open();
        Display.getCurrent.dispose;
    }

    protected Control createContents(Composite parent)
    {
        auto label = new Label(parent, DWT.CENTER);
        label.setText("hello");
        return label;
    }

}

void main(char[][] args)
{
    (new MyWindow).run;

}


executable size : 2.52 MB



-- 
yidabu <yidabu.spam@gmail.com> http://www.dsource.org/projects/dwin

D 语言-中文(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/


May 24, 2008
Thanks for making this test.

Does it make a difference if you don't do the dwtx pragma in the dwt-only hello world?
May 24, 2008
On Sat, 24 May 2008 04:52:34 +0200
Frank Benoit <keinfarbton@googlemail.com> wrote:

> 
> Thanks for making this test.
> 
> Does it make a difference if you don't do the dwtx pragma in the dwt-only hello world?


this is my mistake, dwtx pragma is not necessary in the dwt-only hello world.

-- 
yidabu <yidabu.spam@gmail.com> http://www.dsource.org/projects/dwin

D 语言-中文(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/


May 24, 2008
yidabu wrote:
> dwt hello world size : 1.50 MB
> jface hello world size: 2.52 MB
> 
> the size is not too big!
> the main issue seems too long to build a static library by dsss, this may be a dsss issue.
> I hope that dmd 1.031 will fix the anonymous classe bug and we can use the -lib build flag to build a static dwt lib, dwtx.lib
> 
> tested with dwt-win svn, dwt-addons svn, dmd 1.028
> build dwt.lib and dwtx.lib by dsss 0.75
> testd on Windows XP
> 
> 
> dwt helloworld:
> 
> code:
> 
> import dwt.widgets.Display;
> import dwt.widgets.Shell;
> pragma(lib, "dwt.lib");
> pragma(lib, "dwtx.lib");
> void main ()
> {
>     auto display = new Display;
>     auto shell = new Shell(display);
>     shell.setText = "Hello DWT World ";
>     shell.open;
>     while (!shell.isDisposed)
>         if (!display.readAndDispatch)
>             display.sleep;
> 
>     display.dispose;
> }
> 
> build command:
> 
> dmd test.d dwt.res -L/SUBSYSTEM:windows:5 -L/rc:dwt.res -J..\dwt-samples\res -J..\dwt-addons\res -release
> 
> executable size:
> 1.50 MB
> 

I tried building this, and got a 1.39 MB exe.  It's still quite big.  My DWT application is 1.64 MB, which I don't see as a major problem.  So the size difference isn't huge between a minimal app and a real app.

I built DWT (rev. 211) with dsss, with oneatatime=yes and only '-O -release', no inlining. Then I build the app using bud, with inlining enabled.  I don't know how much the inlining matters, since building dwt takes 35 minutes on my pc, I haven't bothered to test much.  So I'm really looking forward to dmd 1.031, with a usable -lib switch.
May 24, 2008
Hello torhu,

> yidabu wrote:
> 
>> dwt hello world size : 1.50 MB
>> jface hello world size: 2.52 MB
>> the size is not too big!
>> 
>> the main issue seems too long to build a static library by dsss, this
>> may be a dsss issue.
>> 
>> I hope that dmd 1.031 will fix the anonymous classe bug and we can
>> use the -lib build flag to build a static dwt lib, dwtx.lib
>> 
>> tested with dwt-win svn, dwt-addons svn, dmd 1.028
>> build dwt.lib and dwtx.lib by dsss 0.75
>> testd on Windows XP
>> dwt helloworld:
>> 
>> code:
>> 
>> import dwt.widgets.Display;
>> import dwt.widgets.Shell;
>> pragma(lib, "dwt.lib");
>> pragma(lib, "dwtx.lib");
>> void main ()
>> {
>> auto display = new Display;
>> auto shell = new Shell(display);
>> shell.setText = "Hello DWT World ";
>> shell.open;
>> while (!shell.isDisposed)
>> if (!display.readAndDispatch)
>> display.sleep;
>> display.dispose;
>> }
>> build command:
>> 
>> dmd test.d dwt.res -L/SUBSYSTEM:windows:5 -L/rc:dwt.res
>> -J..\dwt-samples\res -J..\dwt-addons\res -release
>> 
>> executable size:
>> 1.50 MB
> I tried building this, and got a 1.39 MB exe.  It's still quite big.
> My DWT application is 1.64 MB, which I don't see as a major problem.
> So the size difference isn't huge between a minimal app and a real
> app.
> 
> I built DWT (rev. 211) with dsss, with oneatatime=yes and only '-O
> -release', no inlining. Then I build the app using bud, with inlining
> enabled.  I don't know how much the inlining matters, since building
> dwt takes 35 minutes on my pc, I haven't bothered to test much.  So
> I'm really looking forward to dmd 1.031, with a usable -lib switch.
> 


I can't seem to get a helloworld size nearly that small, so I assume I must be doing something differently.  Could you please try using ASpack from here (http://www.aspack.com/downloads.html) and test it on your helloworld example? I'd like to see how small it shrinks.

-JJR


May 24, 2008
John Reimer wrote:
> Hello torhu,
> 
>>> import dwt.widgets.Display;
>>> import dwt.widgets.Shell;
>>> pragma(lib, "dwt.lib");
>>> pragma(lib, "dwtx.lib");
>>> void main ()
>>> {
>>> auto display = new Display;
>>> auto shell = new Shell(display);
>>> shell.setText = "Hello DWT World ";
>>> shell.open;
>>> while (!shell.isDisposed)
>>> if (!display.readAndDispatch)
>>> display.sleep;
>>> display.dispose;
>>> }
>>> build command:
>>> 
>>> dmd test.d dwt.res -L/SUBSYSTEM:windows:5 -L/rc:dwt.res
>>> -J..\dwt-samples\res -J..\dwt-addons\res -release
>>> 
>>> executable size:
>>> 1.50 MB
>> I tried building this, and got a 1.39 MB exe.  It's still quite big.
>> My DWT application is 1.64 MB, which I don't see as a major problem.
>> So the size difference isn't huge between a minimal app and a real
>> app.
>> 
>> I built DWT (rev. 211) with dsss, with oneatatime=yes and only '-O
>> -release', no inlining. Then I build the app using bud, with inlining
>> enabled.  I don't know how much the inlining matters, since building
>> dwt takes 35 minutes on my pc, I haven't bothered to test much.  So
>> I'm really looking forward to dmd 1.031, with a usable -lib switch.
>> 
> 
> 
> I can't seem to get a helloworld size nearly that small, so I assume I must be doing something differently.  Could you please try using ASpack from here (http://www.aspack.com/downloads.html) and test it on your helloworld example?  I'd like to see how small it shrinks.
> 

I get 379.5 kB.
May 24, 2008
Hello torhu,

> John Reimer wrote:
> 
>> Hello torhu,
>> 
>>>> import dwt.widgets.Display;
>>>> import dwt.widgets.Shell;
>>>> pragma(lib, "dwt.lib");
>>>> pragma(lib, "dwtx.lib");
>>>> void main ()
>>>> {
>>>> auto display = new Display;
>>>> auto shell = new Shell(display);
>>>> shell.setText = "Hello DWT World ";
>>>> shell.open;
>>>> while (!shell.isDisposed)
>>>> if (!display.readAndDispatch)
>>>> display.sleep;
>>>> display.dispose;
>>>> }
>>>> build command:
>>>> dmd test.d dwt.res -L/SUBSYSTEM:windows:5 -L/rc:dwt.res
>>>> -J..\dwt-samples\res -J..\dwt-addons\res -release
>>>> 
>>>> executable size:
>>>> 1.50 MB
>>> I tried building this, and got a 1.39 MB exe.  It's still quite big.
>>> My DWT application is 1.64 MB, which I don't see as a major problem.
>>> So the size difference isn't huge between a minimal app and a real
>>> app.
>>> 
>>> I built DWT (rev. 211) with dsss, with oneatatime=yes and only '-O
>>> -release', no inlining. Then I build the app using bud, with
>>> inlining enabled.  I don't know how much the inlining matters, since
>>> building dwt takes 35 minutes on my pc, I haven't bothered to test
>>> much.  So I'm really looking forward to dmd 1.031, with a usable
>>> -lib switch.
>>> 
>> I can't seem to get a helloworld size nearly that small, so I assume
>> I must be doing something differently.  Could you please try using
>> ASpack from here (http://www.aspack.com/downloads.html) and test it
>> on your helloworld example? I'd like to see how small it shrinks.
>> 
> I get 379.5 kB.
> 


Thanks!  Not that big of a difference from the old dwt executable sizes afterall. :)

-JJR