terrible executable size if with dsss -full buildflags
Frank Benoit
keinfarbton at googlemail.com
Tue May 6 12:55:02 PDT 2008
yidabu schrieb:
> On Tue, 6 May 2008 17:52:22 +0800
> yidabu <yidabu.spam at gmail.com> wrote:
>
>> On Tue, 06 May 2008 09:12:33 +0200
>> Frank Benoit <keinfarbton at googlemail.com> wrote:
>>
>>
>>> hm, i tested all jface examples in this scenario.
>>> Do you have a chance to locate the problematic place within dwtx ?
>>> stacktrace/debugger?
>> build ok if add -full to dsss buildflags, but the executable size is 14.1 MB to build a simplest JFace sample:
>>
>> 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;
>>
>> }
>>
>>
>> due to the executable is larger if build with dsss -full, I want to build JFace application via dmd:
>> dmd test.d -L/SUBSYSTEM:windows:5
>>
>> but cause unhandled run time exception (swt based code have not this issue):
>> tango.core.Exception.IllegalElementException: Attempt to include invalid key _in Collection
>>
>> how to fix this ?
>>
>
> same executable size if build with dmd directly.
>
> dwt.lib : 6177 KB
> dwtx.lib: 8788 KB
> JFace based executable size: 14MB+ (with -release -O -inline buildflags)
>
> does whole lib linked into JFace based executable?
>
> 14 MB is too bigger!!
>
> how to decrease the executable size (e.g. to 7MB without UPX) ?
>
I don't know exactly why the old dwt is significant smaller in code
size. Perhaps this is because Shawn combined many Java classes into
modules. I decided not to do this, instead I want to stay as close as
possible to the Java sources. So later merges are easier.
Another issue is, to have dynamic libs available. Afaik, at the moment
DMD doesn't support dynamic libs for classes/exceptions/GC on win32 nor
linux. On win32 DDL might be an option. But i don't know if libs would
solve your problem with the executable size.
So my main toolchain issues at the moment are:
- compile speed
- executable size
- dynamic lib supprt (D<->D with classes/interfaces/exceptions/...)
- distribution system with easy install and dependency management
- better debugging support and stacktrace information at runtime
Frank
More information about the Digitalmars-d-dwt
mailing list