I find it hard to believe that a 15-20 MB application will make any difference on current hardware; it represents only a few percent, at most, of available memory even on tiny devices.
At the end of the day, there's nothing you can do. Webkit is not modular, so you're stuck with the whole bundle. I'm just having a hard time believing that a few megabytes is either significant or important.
Today's phones and other mobile devices have enormous amounts of memory available for applications - several hundred megabytes at a minimum.
Before you spend a lot of time solving a problem, it's worthwhile determining whether the problem actually exists.
You're not convincing me that 15-20 MB is a problem.
My first personal computer had 64k of memory, only half of which was available to applications. There are still a few of these around and working, but I don't bother constraining my applications to run on them.
Once again, the answer at the end of the day is simple - you're out of luck. Webkit isn't modular, and doesn't allow you to make use of subsets of its library. If Webkit's size is a problem, you'll have to find some other way to do whatever it is you're working on.
If you want to optimize your binaries for size on Win32, you might want to consider using the MS compiler. The size of the release version QtWebKit4.dll (Qt 4.6.3) is less than 10 MB when built with VS 2008.
Last edited by hobbyist; 25th July 2010 at 17:41.
BTW - have you tried stripping your dynamic libraries and executables? This is commonly done for distributions in order to eliminate unneeded symbols. On Linux, you just say 'strip <object file>'; no idea how to accomplish this on other systems, but there's probably a utility available.I vaguely recall that qmake provides stripping capabilities, but we always did it manually.
Note that this is not the functional stripping mentioned earlier; it simply removes unused symbols from the object's symbol table that aren't required at runtime.
I don't think Windows provides any means of stripping (I'd say DLLs are always "stripped" as only some symbols are exported). It's just removing visible symbol names and labels so don't expect any magic. My stripped version of WebKit is still 17MB in size (Linux/i686).
"Vendors" tend to use WebKit more and more so compiling it statically into your application only makes your application larger without any benefits as WebKit may already be present on the target device.
Bookmarks