[comp.windows.x] Reducing X11 client size!

colin@nbc1.ge.com (Colin Rafferty) (02/12/91)

> How can I reduce the size of my X11R3 (Motif 1.0) programs. 
> I converted a simple data entry appliction to Motif and the size
> of the code went from 200K to 1.3Meg. Thus Motif added 1.1Meg to my code!
> The application now takes a *decade* to start up!!
> I spent more than a  month doing this port! I hope I havent wasted my effort.

The problem is not in your code.  Well not really.  The problem is that you
are using UIL.  Because a program written with UIL doesn't know which
widgets it's using at compile time, when you link your program, all the
possible widgets are linked in.

If you had written your program without using UIL and Mrm, then when you
linked, it would only link in the widgets that you actually use.  This
should cause about a 200-500K increase, not the usual 1.1M.

As a regular Motif/UIL programmer, I understand your problem and can
sympathize with you.  There are really only three choices for you now.  The
first on is to rewrite your UIL into regular C code.  This doesn't have to
reduce all flexibility that UIL gives you, because you can do a lot with
the resource manager.  However, this is a painful process for someone who
choose Motif because you didn't have to write X code (like me).

Your second alternative is to buy a UIL-to-C converter.  Integrated
Computing Solutions (with whom I am not affiliated) has written an
application building program which saves its data as UIL, but can also
generate C code.  You can use this to convert UIL to C.  I'm not sure how
good of an application builder it is.

Your third choice is to leave it alone and live with the slow start-up
time.  This is what I do.

I hope that this helps some.

-- 
Colin Owen Rafferty              |      I believe in compulsory cannibalism.
colin@nbc1.ge.com                |      If people were forced to eat 
(I don't speak for NBC.          |      what they killed, there would
Watch Tom Brokaw for that.)      |      be no more wars.      -- Abbie Hoffman