Native Windows (x86) KoLmafia.exe

Catch-22

Active member
This thread is about the JET build of KoLmafia. It's a native KoLmafia exe. What that means is that the executable runs independently of Java and does not require a JVM. If you have any questions, check the FAQ below first, or feel free to ask in this thread.

Why did you do this?
Mostly out of curiosity, I also noticed that Java was using 600mb of RAM today and I knew that a native exe would use less, not that I have any shortage of RAM or anything...

Why is this useful?
Hmm... Well, if you're running on a Windows system where RAM usage may be a factor, this might be pretty useful to you. Also if you're running on (Windows) systems that for whatever reason will not allow you to install the JRE (due to perhaps domain policies, ie. school or workplace) then this should work too. It might also be handy as a portable app solution for thumbdrives, as again this doesn't rely on the target machine running Java.

How did you do this?
I used Excelsior JET 9.0 (pro version), it was actually pretty easy.

What's with the large file size?
I optimized the build package for launch speed as opposed to disk footprint. I've tweaked the build process a little since the initial release though, which has reduced the disk footprint from what it once was.

How do I get it working?
You'll need to extract the 7-zip files into a directory of your choice. The rt.7z file contains the Excelsior JET runtimes and needs to be extracted to the same directory (leave them in the /rt/ folder though). With new releases, you should just need to download KoLmafia.7z and replace the old exe.

Are there any benefits in this?
Well, my launch time is practically instantaneous (probably due to no longer having to invoke a JVM at launch), my RAM usage has not gone higher than 64mb as of writing and the GUI seems subjectively more responsive. I haven't tried any other comparisons as yet (ie. arithmetic performance). Feel free to try it out and let me know what you think :)

Are you planning to support this?
Yes! Thanks to Holatuwol, I'm able to provide builds on the SourceForge page roughly once a day. Let me know if you have issues with the JET build specifically (ie. not a KoLmafia bug).

Are you planning on compiling an x64 version?
Short answer: No, but maybe some day. You shouldn't need it.
Long answer here.

This is a stupid idea!
Hey, it's not for everyone, there's no need to hate!


KoLmafia

Excelsior JET 9.0 Runtimes

This script should let you know when a new build has been uploaded to sourceforge, feel free to add it to your login script.
 

Attachments

  • check_JET_build.ash
    849 bytes · Views: 228
Last edited:

Catch-22

Active member
Are you planning on compiling an x64 version?

Currently there's no compiler capable of doing this (on Windows). GCJ for MingW32-w64 is currently broken, so that's off the cards. Excelsior have an alpha version capable of it though, but it's not ready for general use ("very poor performance"). I can't imagine why KoLmafia would ever need to address Java heaps above 4GB, but yes an x64 edition would be nice I suppose.

Any version of Windows that runs WoW64 (ie. all 64-bit versions of Windows) will be able to run the x86 executable though (I have actually only used this on 64-bit versions of Windows).
 
Last edited:

xKiv

Active member
64-bit code means native 64-bit integers, which means (slightly) improved performance now that mafia moved to (64-bit) longs.
At least that's my understanding of one thing that would happen.
 

Catch-22

Active member
64-bit code means native 64-bit integers, which means (slightly) improved performance now that mafia moved to (64-bit) longs.

Eh, well you're right in the sense that there are certain registers available only in x86_64 which may reduce the amount of caching done by the CPU, but memory addressing becomes a more complicated matter. I'm no CPU architecture expert, so I'll leave it up to Sun to explain that the performance is likely going to be the same or worse on 64-bit.
 
Last edited:

xKiv

Active member
Eh, well you're right in the sense that there are certain registers available only in x86_64 which may reduce the amount of caching done by the CPU, but memory addressing becomes a more complicated matter. I'm no CPU architecture expert, so I'll leave it up to Sun to explain that the performance is likely going to be the same or worse on 64-bit.

I was talking purely about the 64-bit arithmetics (which are probably faster when operating on 64-bit registers than when operating on twice the number of 32-bit registers), but OK.
 

holatuwol

Developer
I was talking purely about the 64-bit arithmetics (which are probably faster when operating on 64-bit registers than when operating on twice the number of 32-bit registers), but OK.
Any benefit from 64-bit arithmetic would be negligible, since KoLmafia is mostly heavy in string sorting and string comparisons (which operate on 8-bit or 16-bit characters) and network I/O.
 

Catch-22

Active member
Due to the new server cookies I have updated the package to r11180.

I separated the runtimes and the exe so hopefully future updates won't be such a hefty download. You'll probably need to download the runtimes package again though, if you are one of the 5 people who downloaded the old release.

This new release was built using Excelsior JET 7.6 Standard Edition (big thanks to Dmitry from Excelsior for providing me with a license). The downside of this is there are less optimizations done at build-time, but the upside is I can support builds for longer than the evaluation period of the pro edition.

Any feedback is welcome guys, even if you just tried it out and didn't like it.
 

Theraze

Active member
Suggestion for the future... make the downloads NOT inline? It helps people know what they've already downloaded, because if the support files have 3000 downloads and the mafia file has 2, they probably need to download the mafia file again. :)
 

Catch-22

Active member
Suggestion for the future... make the downloads NOT inline? It helps people know what they've already downloaded, because if the support files have 3000 downloads and the mafia file has 2, they probably need to download the mafia file again. :)

Thanks for the suggestion Theraze. The files are too large to post as an attachment on the forums, so they are actually hosted externally. I was thinking about putting a "Last updated" section in the post so people will know if the runtimes have changed, so I will probably do that :)
 

Theraze

Active member
Ah, right. I keep forgetting that they're mediafire, not native. :) Even though I hovered over them right before I posted that. Meh. :)

But yeah, posting update dates on them should at least let people know roughly what they need to update, when. :)
 

Catch-22

Active member
This is very useful for putting Kolmafia on a flash drive.

Thanks :) I'm glad you find it useful.

I've updated to r11192 because there's a lot of new content flying about the place lately. The runtimes haven't changed so just download KoLmafia.7z (which is now just a 2.79mb download), let me know if you have any problems with it :)

On a technical note, I'm working on tweaking/automating the build process. I've reduced package size fairly significantly since the last build and my build times are now only about 3 times that of a JAR build, which is a big improvement over the 20 x longer it used to take!
 

Catch-22

Active member
Updated to r11231 and somehow managed to shrink the download down to 2.62mb. Runtimes remain unchanged and shouldn't need to be downloaded again.
 

Catch-22

Active member
This is one of the more interesting build ideas I've seen. Perhaps I can adapt this to OSX and Linux...

Yeah, unfortunately the gcj doesn't seem to be in active development these days. It'd be great if I could get gcj working for all 3 of the major operating systems (that way I could use the same build process), but it became too much of a headache :(

Once Oracle bring the good parts of JRockit over to HotSpot, there won't really be a need for AoT compiled classes on any system that can run the OpenJDK, though.
 

Catch-22

Active member
Updated to r11267 (actually yesterday). Also added a nifty update check script, which should let you know if there has been an updated build posted.
 

dangerpin

Member
Ok, I have to admit I was VERY skeptical about this and how it would work. But you just made me a true believer! Mafia is responsive on my Win machine in a way it hasn't been for years, literally. Instead of having the memory usage sitting at half to three-quarters it is barely registering even on complex scripts. When I abort it happens IMMEDIATELY and not 25 seconds later. I can switch tabs in the middle of scripts without it bogging down and failing to respond until after the script finishes.

This is packed full of win like a pinata is full of sweets.

I doff my cap.
 

slyz

Developer
That made me want to try it :)

Unfortunately, I get an error noise (but no message) when I try to launch it, and nothing happens. Win XP, in an empty folder except for KoLmafia and /rt.
 

slyz

Developer
Derp. Thanks to my super-unzipping skills, the runtimes ended up in /rt/rt. That's why it wasn't working.

My relay browser experience is significantly smoother and faster. Until proven wrong, I'm going to believe it is due to Catch-22's build. Thanks a lot!

Any tips on how to compile my own builds, so I can keep an up-to-date version?
 
Top