HaxeFoundation / hxjava

Haxe Java support library. Build scripts and support code.
The Unlicense
46 stars 14 forks source link

Add Java 8 classes. Again. #28

Closed posxposy closed 5 years ago

posxposy commented 5 years ago

Hello, hxjava-std lib has been reduced from 64mb to 14.5mb.

Also, I added sources of the jar-tool for stripping the code from .jar's. For future use. It's a bit dirty, but works.

closes #27

Simn commented 5 years ago

There should be some more stuff to get rid of. If there is no code, we can also remove the StackMapTable attribute as well as the Exceptions attribute. There's probably even more, but let's start with these.

nadako commented 5 years ago

Awesome, thank you for this!

I wonder though if we should use a more recent java version?

nadako commented 5 years ago

So are we merging this?

Simn commented 5 years ago

IMO we should look into removing these attributes I mentioned. That should help with the file size.

posxposy commented 5 years ago

Will try to do something for Exceptions attributes. But do not know yet how to deal with StackMapTable.

posxposy commented 5 years ago

Well, I did a slight change which gives better results. Now, the file is 64 -> 11.9mb!

But I did not find ways to clean exception or stackmaptable attributes yet. ASM lib does not invoke any callbacks on attributes at all. Removing redundant annotations did not give a big difference, just saves ~40kb which is nothing.

Also, I tried to investigate previous hxjava-std and found that there is removed com.sun.* package from it at all. I'm not sure why. But, If I'll do the same for the new one then after code stripping, it will weight the only 7mb. So, full package: 11.9mb; Without com.sun.*: 7mb;