|
|||||||
| Register | Members List | New Posts | Mark Forums Read |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Kasper's Automated Slave
Join Date: Nov 1997
Posts: 6,171
|
Solving the mystery of Snow Leopard's shrinking apps
In response to a report earlier this week pointing out that many of the applications in early builds of Mac OS X 10.6 Snow Leopard are dramatically smaller in size, a number of developers have weighed in to explain where all those missing megabytes went.
Bryce C noted that the extra heft in Leopard's apps does indeed come from localization files, which are used to distill all of the text strings and other variables that differ between languages. Depending on the language preference set by the user, the operating system accesses the desired language files and uses them in conjunction with the common application code to simplify developers' work to deploy their apps to worldwide markets. Inside each application's bundle file in Mac OS X are NIB files, shorthand for the original name of the tool used to create them: NeXTSTEP Interface Builder. NIB files also contain any graphical resources used by the application. During development, Interface Builder is used to visually arrange the program's interface controls -- from buttons to scroll lists -- which are then mapped to actions. The original XML files used during development are named "designable.nib," but these files are not supposed to ship with the finished application. The final NIB files that are included with the finalized application are much smaller, and can usually be compressed even further. Running these NIB files through a simple file compression results in dramatic disk savings. Bryce noted that the XML and HTML files stored within the bundle of Leopard's Mail shrink from 289 MB to 96.6 MB with a simple file compression, resulting in a file size comparable to the new Mail delivered in the Snow Leopard beta release. Apple earlier applied a similar technique to preference .plist files, converting them from plain human readable XML text files into compressed binaries to save space on disk. The added overhead required to compress and uncompress these files in the background as they are read from and written back to disk is insignificant. While Apple may likely be expanding the use of background file compression to save space in Snow Leopard, today's Mac OS X Leopard is unnecessarily overweight due to an error Apple made when packaging the system, according to a developer who asked to remain anonymous. Leopard apps all contain superfluous designable.nib files that should have been removed in the Golden Master. "Mail alone has around 1400 of these files, taking up almost 200 MB of disk space," he noted. Other suspected reasons for the dramatic weight reduction included lighter weight, resolution independent vector graphics and the removal of PowerPC code. However, the same developer explained that "most of the artwork in the applications is the same as it was in Leopard. Snow Leopard is, sadly, not much further along in resolution independence than Leopard, at least in the developer preview." The move to vector graphics may make a small additional impact on tightening up the system, and even graphical interface elements stored as bitmapped art will benefit from the file compression noted above. As for the removal of PowerPC code, developers note that Snow Leopard's applications are still currently being delivered as Universal Binaries anyway, and that removal of that extra code has a very limited impact on file size when compared to the results of compressing large XML and graphics files related to interface localization and the complete removal of any unnecessary development NIB files. Leopard users tight on disk space can safely delete all of the designable.nib files stored within their apps and use a tool such as Monolingual or Northern Softworks Leopard Cache Cleaner to remove unused foreign language files, resulting in a free weight reduction without the wait. |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Jul 2005
Posts: 78
|
so is smaller size mean faster running?
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jun 2008
Posts: 204
|
Well if there were tons of designable.nib files in Leopard that took up space, then Snow Leopard isn't so much revolutionarily lean as Leopard was unnecessarily bloated. Kind of disappointing really.
Although runtime compression/decompression is good idea. I wonder how it's efficiency compares to the compression option available in NTFS? |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Apr 2007
Posts: 68
|
I just downloaded monolingual and it is tearing through my files! over 3 gigs freed already. Looks like adobe is a nasty culprit as well. Very cool.
|
|
|
|
|
|
#5 |
|
Registered User
Join Date: Jun 2003
Location: The other side of the mirror.
Posts: 110
|
I found 533 designable.nib files, all in all 47.8MB. Not really as much as advertised. You guys really sure I can just delete those?
guest account
|
|
|
|
|
|
#6 |
|
Registered User
Join Date: May 2008
Posts: 2
|
Well, this is not really revolutionery. In fact Xslimmer and few other applications already does this in Leopard. If you try that you'd be amazed by how much garbage you have dumped on your (paid) mac's hard drive space without ever knowing that,
I presumably have saved few GBs on my application volume. |
|
|
|
|
|
#7 |
|
Registered User
Join Date: Oct 2005
Posts: 17
|
You might wanna check out the read me file, it says to EXCLUDE adobe apps cos they might not work if you remove localisations!
|
|
|
|
|
|
#8 | |
|
Registered User
Join Date: Apr 2005
Location: Denver, CO USA
Posts: 130
|
Quote:
A year ago I foolishly removed all the unused languages and was forced to do a complete re-install of my Adobe apps. |
|
|
|
|
|
|
#9 |
|
Registered User
Join Date: Jun 2003
Location: Ithaca, NY
Posts: 2
|
The designable.nib file isn't necessary at all in a shipping product. With Interface Builder 3, there is a new XML format for nib files, which are now stored as .xib files. These XML files are only used for development, and are a single file as opposed to the old .nib packages, which would often cause problems with source control systems such as Subversion (e.g. replace one nib package with another and you wipe out the .svn directory contained within).
The new .xib files are much easier to use for development, but when it comes to actually shipping an application, for backwards compatibility, you still need a .nib package in your app bundle. Xcode 3 performs this conversion when building your app, and "compiles" a .nib package with a keyedobjects.nib file inside. The keyedobjects.nib file is the only file a shipping application needs to have to function properly. The compilation step can optionally include a copy of the XML version of the file as well. The designable.nib file is basically a straight copy of the .xib file from your project. This file is necessary if you want to open up the nib and edit it with Interface Builder, but it's not necessary to just run the application. For shipping apps, you'll typically want to turn off the flag that copies the designable.nib file, since it just takes up space and is never used. You might want to include it in some scenarios, such as a debug build you're sending to a localizer, since they'll need to be able to edit the nib file. The problem is that Xcode 3 is set up by default to copy the designable.nib file into your built app, even for release builds. The result is that many of Apple's apps (as well as third party apps) unknowingly include these files, even though they don't need them. So all that really needs to be done is to change this setting in Xcode so that the built apps don't include the designable.nib files, and that's how you get your hard drive savings, no fancy compression necessary. |
|
|
|
|
|
#10 |
|
Registered User
Join Date: Jun 2003
Posts: 431
|
Not until you run an Adobe upgrade that targets those files you removed, then the installer quits half-way through and you're left with an application that doesn't launch. That's my story of using Monolingual and I never will again because of the massive headache it caused.
|
|
|
|
|
|
#11 | |
|
Registered User
Join Date: Jan 2007
Posts: 855
|
Quote:
![]() |
|
|
|
|
|
|
#12 |
|
Registered User
Join Date: Feb 2008
Posts: 165
|
Wait a second... your telling me all these apps are only smaller because a few nib files were removed
that's it? I have always been saying they couldn't provide such a big update in a dot update, but... ehh I just hope there is more to come. Making apps monolingual (or bilingual for those who need it....) removing PPC code, and using vector graphics would be pretty exciting. I love vector graphics. Does anyone wanna see my 20 megapixel Firefox icon? ![]() |
|
|
|
|
|
#13 | |
|
Registered User
Join Date: Jan 2007
Posts: 855
|
Quote:
|
|
|
|
|
|
|
#14 |
|
Registered User
Join Date: Apr 2007
Posts: 11
|
VERY interesting. From the Get Info dialog, I removed all of Mail's languages except English. Then I ran a terminal script to remove all of the designable.nib files from Mail.app. My Mail app is now 14.3 MB, and works great. Impressive space savings. If Snow Leopard does some file compression as well, the file sizes could be significantly improved. I know disk space is cheap these days...but still, why take up all that space unnecessarily?
|
|
|
|
|
|
#15 | |
|
Registered User
Join Date: Nov 2004
Location: Northwest
Posts: 2,699
|
The point of the size of these application bundles is due to the design by application bundle.
NeXTSTEP didn't bundle their localization structures this way. We [having worked there] didn't bundle our applications via drag n' drop to install or trash an application. The dynamically loaded nib files, by localization, is not surprising. The executables being twice as large, in some instances, should be a clue they have possibly not just optimized the run-time and executable binaries, but that there is a good chance the .nib file format and what it contains: http://developer.apple.com/documenta...5344-CH11-SW13 Quote:
|
|
|
|
|
|
|
#16 | |
|
Registered User
Join Date: Nov 2004
Location: Northwest
Posts: 2,699
|
Quote:
|
|
|
|
|
|
|
#17 | |
|
Registered User
Join Date: Feb 2008
Posts: 1,415
|
Quote:
Ironically, Adobe *is* one of the biggest culprits in this kind of bloat. There are literally thousands and thousands of files in a CS3 installation that are completely unnecessary and loaded onto your HD in triplicate or more. For instance every Adobe product has a "legal" folder with the licence agreements for the product in it. Why something that is never read by anyone needs to be copied to your HD I don't know, but making it worse, is that it's copied *hundreds* of times. The licence agreements are printed in 30 to 40 languages and an identical folder is every folder for every product in the applications folder. So in order to convey a simple legal licence to the end user, we have hundreds of useless files and folders on the HD, most of which is unreadable by the user. And the support folders for Adobe in the libraries contain hundreds of thousands of files taking up gigabytes of space. All mostly for no reason at all. Not to mention the four or five applications that they always install in the background that you haven't even agreed to and can't find out what they are even. ![]() |
|
|
|
|
|
|
#18 | |
|
Registered User
Join Date: Jul 2003
Posts: 2,481
|
Quote:
On another note I suspect that Apple has lots of room to improve the size of libraries and generated code. GCC is continually improving and Apple hasn't been reluctant to improve Objective C. There is big hope that all of Snow Leopards internal improvements lead to streamlined libraries. This will likely be very good for applications moving forward. The question is just how backwards compatible will Apple be. Dave |
|
|
|
|
|
|
#19 |
|
Registered User
Join Date: Jul 2002
Location: Inside the beltway, outside the District.
Posts: 292
|
Wow
So as an experiment I deleted all of those files. My Applications folder went from 2.3 GB to 500 MB… then shot up to 5 GB. I have no idea what the hell is going on here, but I'll be restoring my backup when I get home.
Ridiculous lucky captain rabbit king, lucky captain rabbit king nuggets are for the youth!
|
|
|
|
|
|
#20 |
|
Registered User
Join Date: Feb 2006
Location: Ireland
Posts: 8,565
|
Sorry but that made me chuckle.
Collecting my SSD iMac Fry-die. :D
|
|
|
|
|
|
#21 |
|
Registered User
Join Date: May 2008
Posts: 333
|
Make sure you dumped the files from your trash or they won't disappear and your restore may have been for nothing
|
|
|
|
|
|
#22 |
|
Registered User
Join Date: May 2002
Posts: 834
|
I found all designer.nib file on my disk (sudo find /* -name designer.nib) and added up the sizes - Just over 600MB.
|
|
|
|
|
|
#23 | |
|
Registered User
Join Date: May 2008
Posts: 2
|
get info rocks
Quote:
|
|
|
|
|
|
|
#24 |
|
Registered User
Join Date: Dec 2004
Posts: 87
|
How is this a mystery? It's been obvious all along that the apps in 10.6 are smaller due to getting rid of non-essential localization files (something many of us have already been doing for years). The fact that Snow Leopard is going to be Intel-only will also allow removal of PPC code. From what I've heard that hasn't been done yet in the developer preview, but no doubt it will shrink things down further.
|
|
|
|
|
|
#25 | |
|
Really Fast Typing Member
Join Date: Nov 2001
Location: Ossining, NY
Posts: 8,575
|
Quote:
And, as discussed above, the actual binary executables are generally a small fraction of the total disk space used by an app. Further yes, but only a % point or few.
My brain is hung like a HORSE!
|
|
|
|
|
|
|
#26 |
|
Banned
Join Date: Aug 2003
Posts: 526
|
It would seem that the credit for any improvements in Snow Leopard are more to Apple stopping bad practices than inventing new good ones.
Now if only they'd do the same to the GUI. Starting with Finder, the Dock and Spotlight. |
|
|
|
|
|
#27 |
|
Registered User
Join Date: Sep 2007
Posts: 3
|
Safari
Just deleting the superfluous language files in Leopard Safari 3.1.1 drops the package size from 60+ meg to 9.2 meg.
Also, same problem with Adobe apps. Don't use Monolingual. Adobe updaters stop mid-update if the original installation is modified. Only option is to reinstall from scratch. |
|
|
|
|
|
#28 |
|
Registered User
Join Date: Mar 2007
Posts: 115
|
exactly. this may be useful to save space on the iphone, but on computers? people use 500 GB HDs or much more. HD prices fall almost as fast as memory does. so if the apps are not faster that I doubt, this 'feature' does not make much difference.
|
|
|
|
|
|
#29 |
|
Registered User
Join Date: Jul 2005
Posts: 29
|
It does when you move to solid state drives. Even if the drives were the same size, more open space = more space for rotating writes = longer drive life.
|
|
|
|
|
|
#30 | |
|
Registered User
Join Date: Oct 2004
Location: Gatineau (Quebec)
Posts: 308
|
Great article!
Quote:
Great article! Thanks for the reference to Monolingual or Leopard Cache Cleaner. It's great to have an article which describes a problem, but goes the additional step of including the solution. Great work! Thanks to the author. ![]() ![]() ![]() |
|
|
|
|
|
|
#31 |
|
Privileges Revoked
Join Date: Jan 2008
Location: Currently where I am located.
Posts: 1,067
|
Hi g.money. I have heard of get info ( I think), what is it exactly and does it remove all the localization files.
|
|
|
|
|
|
#32 |
|
Registered User
Join Date: Mar 2005
Posts: 366
|
You suggest binary plists have to be decompressed. I'd say you're wrong, and that binary plists are probably faster than xml plists as they can be read straight in without going through a full XML parser.
|
|
|
|
|
|
#33 | |
|
Banned
Join Date: Aug 2003
Posts: 526
|
Quote:
You seem to be saying it is only good for a certain number of wipes and rewrites. Exactly what sort of practical storage life do these thing have? |
|
|
|
|
|
|
#34 |
|
Registered User
Join Date: Jul 2002
Location: Inside the beltway, outside the District.
Posts: 292
|
They were deleted by the rm command, so I'm quite certain they're gone.
Ridiculous lucky captain rabbit king, lucky captain rabbit king nuggets are for the youth!
|
|
|
|
|
|
#35 | |
|
Registered User
Join Date: Aug 2002
Location: Portland OR
Posts: 407
|
Quote:
"An investment in knowledge always pays the best interest."
"Those who would give up essential liberties to purchase a little temporary safety deserve neither." -Ben Franklin |
|
|
|
|
|
|
#36 | |
|
Registered User
Join Date: Mar 2005
Posts: 366
|
Quote:
See http://en.wikipedia.org/wiki/Flash_memory#Limitations |
|
|
|
|
|
|
#37 |
|
Registered User
Join Date: Jul 2007
Posts: 40
|
To those of you deleting files randomly from your computer:
When you start to do things like remove .NIB files, extraneous language files, Power PC code, etc., you are likely breaking the ability for Apple Software Update to detect and install product updates. After deleting these files, the applications that they are attached to are not longer recognizable, and can't be patched by ASU. I'd say don't do it, unless you're prepared to manually check for and download the full installation packages for any OS updates from Apple. |
|
|
|
|
|
#38 |
|
Registered User
Join Date: Sep 2005
Posts: 1
|
I haven't tried myself, but I'd recommend caution in using Monolingual. Having read this topic I looked it up and came across a variety of warnings to use it only with caution or not at all (e.g. can totally break your system). You may want to update this post with a warning.
Info: http://osx.iusethis.com/app/monolingual http://www.versiontracker.com/dyn/moreinfo/macosx/13031 |
|
|
|
|
|
#39 |
|
Registered User
Join Date: Nov 2006
Posts: 2,077
|
Null.
Þ & þ are called "Thorn" & þey represent þe sound you've associated "th" wiþ since þe 13þ or 14þ century. I'm bringing it back.
<(=_=)> (>=_=)> <(=_=<) ^(=_=^) (^=_=)^ ^(=_=)^ +(=_=)+ Last edited by Slewis; 11-09-2008 at 08:02 AM.. |
|
|
|
|
|
#40 |
|
Registered User
Join Date: Nov 2006
Posts: 2,077
|
Null.
Þ & þ are called "Thorn" & þey represent þe sound you've associated "th" wiþ since þe 13þ or 14þ century. I'm bringing it back.
<(=_=)> (>=_=)> <(=_=<) ^(=_=^) (^=_=)^ ^(=_=)^ +(=_=)+ Last edited by Slewis; 11-09-2008 at 08:01 AM.. |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|