We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
a lighter core library (Read 1729 times)
a lighter core library
Feb 1st, 2006, 10:49am
 
As I read on the FAQ, one of the reason of choosing java is allowing of displaing the sketches on the net via the JVM.

In this goal, I think the core library is too heavy. I've made a little game of 182Kb and the core library is 140Kb. I'm not using many funtions of the core library so I guess the game could have been about 100Kb, maybe less.

For those little games, the loading time is very important. Despite the increase of download bitrates of the end users, a light applet is very important because it preserves the server bandwidth and the visitor of the web page is always irritated to wait too long.

I think it would be a great evolution to split the core library in several libraries. Image management, file management, sound management, matrix management and maybe other themes that are not necessary in all projects.

What do you think about that?
Re: a lighter core library
Reply #1 - Feb 1st, 2006, 12:55pm
 
You can use Proguard or other jar compressors to significantly reduce the size of your applets.

Actually I had a little trouble with it myself, but it's something toxi looked into for Processing alpha and I'm sure it's possible with the beta version too.

More references here...
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Collaboration;action=display;num=1131272851

And here...
http://processing.org/discourse/yabb/YaBB.cgi?board=general;action=display;num=1084458628

I'm also looking at a set of scripts to help you publish several different applets and share one core.jar download on the same site (which is what we used to do at openstreetmap.org) - I'll keep you posted.
Re: a lighter core library
Reply #2 - Feb 1st, 2006, 10:14pm
 
also from the faq, and covered multiple times elsewhere on this board:
http://processing.org/faq/bugs.html#known

"The size of exported applets is larger than we would like, but we'll get things smaller and more optimize again. Having separated the 2D and 3D libraries, eventually we won't have to include the 3D code when using 2D."

http://dev.processing.org/bugs/show_bug.cgi?id=127
Re: a lighter core library
Reply #3 - Feb 2nd, 2006, 10:53am
 
Thanks.

I've used Proguard and it's terrific.
The size of the 2 applets I had :

Without proguard : 185Kb and 186 Kb
After proguard : 75Kb and 76Kb

About 40% of the original size!

I used the GUI of proguard 3.5 but the default configuration was not working properly. I don't know why but the PGraphics2 constructor (in,in,PApplet) was shrinked but shouldn't have been. You must add a "keep" option for this class and it works just fine.

As Proguard seems to be reliable, I wonder if it could be integrated in the processing IDE. When exporting to Sketch.jar, why not also building a Sketch_fortheweb.jar?


Re: a lighter core library
Reply #4 - Feb 2nd, 2006, 11:58am
 
Just an fyi guys, these days even Javascript libraries easily run 150K on popular web sites.  I agree, I wouldn't mind a smaller file size, but it's not priority one Smiley

Sheesh, even 150K can be spent in one image.
Re: a lighter core library
Reply #5 - Feb 2nd, 2006, 12:02pm
 
sietjp wrote on Feb 2nd, 2006, 10:53am:
I've used Proguard and it's terrific.


Doesn't the latest Mobile Processing supports proguard!
Should be easily integrated into the PDE.
Re: a lighter core library
Reply #6 - Feb 2nd, 2006, 2:43pm
 
FloHimself wrote on Feb 2nd, 2006, 12:02pm:
Should be easily integrated into the PDE.

almost everything is easy. getting time to do it is not.
Re: a lighter core library
Reply #7 - Feb 2nd, 2006, 2:46pm
 
That's no reproach... I agree...
Page Index Toggle Pages: 1