Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Where's the compile n' shrink?  (Read 2117 times)
0 Members and 1 Guest are viewing this topic.
Offline appel

JGO Wizard


Medals: 49
Projects: 5


I always win!


« Posted 2012-12-01 20:44:27 »

Where's that delightful little web page?

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2012-12-01 20:50:43 »

It was crashy: some of the external processes like *gasp* javac, would hang and cause 100% CPU usage indefinitely. Last year I took the same source code, and used windows ports of kzip and others. The results were so bad (as in: not even close ) that I didn't bother to continue the effort.

It's really not rocket science... it's just that you rely on external processes which either do a good or bad job.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Online pjt33
« Reply #2 - Posted 2012-12-01 21:00:24 »

For people who want a build environment on their home computer, there's quite a bit of stuff in http://www.java-gaming.org/topics/indiespot-compression-not-working/25147/view.html

I can post my bash files if anyone wants them, but I think I really need to borrow some stuff from that thread instead.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline davedes
« Reply #3 - Posted 2012-12-01 21:27:52 »

Currently what I'm doing for speed/efficiency:

1. Compile (my Eclipse compiles on save)
2. JShrink GUI -> reopen "class" file, then save it as a JAR.
3. Pack200 the resulting JAR:
1  
pack200 -G -E9 -r G.pack200.jar G.jar

4. Compare.

Sometimes I throw Proguard into the mix, but it tends to be pretty slow and annoying to use during development.

Proguard settings (Mac):
1  
2  
3  
4  
5  
6  
7  
-libraryjars "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar"
-injars "G.jar"
-outjars "G.proguard.jar"
-allowaccessmodification
-overloadaggressively
-defaultpackage ''
-keep public class G extends java.applet.Applet


Once I start getting closer to my byte budget, I'll probably have to experiment with some other compression techniques...

Offline Groboclown
« Reply #4 - Posted 2012-12-02 02:36:05 »

Last year I worked on creating a bundle that can be used for an automated build.  I've put that into a new Mercurial package out at my bucket site:

hg clone http://groboutils.hg.sourceforge.net:8000/hgroot/groboutils/java4k

It doesn't bundle JShrink or yGuard due to licensing issues, nor does it include any of the compression programs.

Note that full builds with this can end up running for an hour, as it exhaustively checks different kzip settings to cut the size down by a few bytes.

Offline appel

JGO Wizard


Medals: 49
Projects: 5


I always win!


« Reply #5 - Posted 2012-12-02 02:42:17 »

Maybe an applet that uses the client's processing power to generate the jar, instead of the server?

It would be an applet that has one text area for the java code, maybe the target jre, and one button to generate a jar that the user can somehow download from the applet. Possible?

That way that app can be hosted on java4k.com for posterity.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #6 - Posted 2012-12-02 02:52:10 »

See my reply. Pointing (Results were poor.)

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline masteryoom

JGO Coder


Medals: 5
Projects: 3


If you look closely, you might see it turning...


« Reply #7 - Posted 2012-12-02 03:15:17 »

When I used JShrink on one of my files, I nearly fell out of my seat. It reduced my Jar file by 1 KB!! It was enough to put it on J4k, but it was an application.

Smiley
Online pjt33
« Reply #8 - Posted 2012-12-02 15:35:03 »

Maybe an applet that uses the client's processing power to generate the jar, instead of the server?
Needs a good Java zip library. kzip is only distributed as binary, and while 7zip is open source it would still need porting.
Offline matheus23

JGO Wizard


Medals: 97
Projects: 3


You think about my Avatar right now!


« Reply #9 - Posted 2012-12-02 15:36:22 »

Maybe an applet that uses the client's processing power to generate the jar, instead of the server?
Needs a good Java zip library. kzip is only distributed as binary, and while 7zip is open source it would still need porting.
Hasn't java got a built-in zipping library?

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Danny02
« Reply #10 - Posted 2012-12-02 15:50:50 »

and while 7zip is open source it would still need porting.

there should be a Java port on the offical site, there is also a lzma package on maven with normal io streams
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #11 - Posted 2012-12-02 17:31:54 »

lzma is not supported by the java plugin.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Online pjt33
« Reply #12 - Posted 2012-12-03 00:42:25 »

Maybe an applet that uses the client's processing power to generate the jar, instead of the server?
Needs a good Java zip library. kzip is only distributed as binary, and while 7zip is open source it would still need porting.
Hasn't java got a built-in zipping library?
Yes, but it's a bog standard one, and probably uses a simple greedy parser. A good zip library will squeeze a few more bytes out. As a quick test I've just compressed a group of already fairly well compressed programs I had sitting in my temp directory with both jar and kzip. jar got them down to 90.6% of the original size, and kzip to 88.6% of the original size.
Offline luisoft

JGO Coder


Projects: 6


Java games rock!


« Reply #13 - Posted 2012-12-03 15:40:50 »

Last year I used the script from Erik Byström:

http://blog.slackers.se/2011/01/java-4k-competition-2011.html

Didn't test it for Java 7.

Offline Roquen
« Reply #14 - Posted 2012-12-06 15:06:00 »

I just happened to visit Charles Bloom's web-site and ran across this (in case the are any folks with compression experience that are bored):  http://cbloomrants.blogspot.fr/2012/01/01-09-12-lz-optimal-parse-with-star.html
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (23 views)
2014-04-15 18:08:23

BurntPizza (18 views)
2014-04-15 03:46:01

UprightPath (32 views)
2014-04-14 17:39:50

UprightPath (16 views)
2014-04-14 17:35:47

Porlus (32 views)
2014-04-14 15:48:38

tom_mai78101 (58 views)
2014-04-10 04:04:31

BurntPizza (116 views)
2014-04-08 23:06:04

tom_mai78101 (216 views)
2014-04-05 13:34:39

trollwarrior1 (183 views)
2014-04-04 12:06:45

CJLetsGame (190 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!