Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!usc!elroy.jpl.nasa.gov!jpl-devvax!david From: david@jpl-devvax.JPL.NASA.GOV (David E. Smyth) Newsgroups: comp.windows.x Subject: Huge Motif Programs Message-ID: <11411@jpl-devvax.JPL.NASA.GOV> Date: 12 Feb 91 20:09:44 GMT Reply-To: david@jpl-devvax.JPL.NASA.GOV (David E. Smyth) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 49 References: I recently was forwarded these comments: > > > 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 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. In truth, you *always* get virtually *all* of Motif if you use *any* of Motif. I assert that there is simply no way to get only 200-500K sized statically bound Motif programs. If you do "Hello World" with just a push button you get virtually everything. Therefore, you pay very little for using UIL or Wcl or any other scheme which references all Widgets instead of just some of them. The real solution is to use shared libraries! On a Sun4, using static binding, we get these sizes for a "Hello World" Wcl program which links in the following widgets: Only PushB 942080 PushB & RowCol 942080 PushB, RowCol, & Text 1155072 Everything 1400832 You just are not going to get much savings for all the pain you inflict upon yourself. If you use shared libraries, you get: Only PushB 24576 Everything 32768 ------------------------------------------------------------------------- David Smyth david@jpl-devvax.jpl.nasa.gov Senior Software Engineer, seismo!cit-vax!jpl-devvax!david X and Object Guru. (818)393-0983 Jet Propulsion Lab, M/S 230-103, 4800 Oak Grove Drive, Pasadena, CA 91109 ------------------------------------------------------------------------- "There was a time when man would attribute everything he didn't understand to God. Now, with our heightened understanding of science, we attribute them to UFO's." -Gary Friedman -------------------------------------------------------------------------