Skip to content

FastEmu v0.3.0

Choose a tag to compare

@github-actions github-actions released this 01 Dec 00:09
· 6 commits to main since this release
641f58f

Added

  • A built-in phone of 240x400 with a touch screen, the size of Nokia's Asha 311 and of many Samsung and LG touch phones. A game whose JAD or manifest declares 240x400 now starts on it (#142).

Changed

  • Compiled game code now calls the methods it has compiled straight away, instead of through the virtual machine's own call path, so a game's small methods cost less to call. The bench's recursive call test runs 3.5 times faster than in 0.2.0, its object test 4.2 times, its sort 29 percent faster and its small object test 18 percent (#128).
  • Compiled game code now runs a game's smallest methods, such as the getters, setters and constructors of its objects, inside the code that calls them, without a call at all. The bench's small object test runs 8 percent faster than with direct calls alone; the other tests run as before, since their methods are too large to run this way (#128).
  • Compiled game code now works out Math.max, Math.min and Math.abs itself, the library calls games make most, instead of calling into the virtual machine for each: a call takes under 1 ns where it took about 20. Stick Fight makes 63 thousand of them a second. The library's other short calls (a String's length and characters, StringBuffer's appends, Vector and Hashtable reads and writes, Integer values) skip the frame they were given, with compiling on or off. The bench's string test takes 6 to 16 percent less time and its collection test 13 to 18 percent less (#129).
  • Games that build text or keep lists and tables run faster. StringBuffer adds numbers and text without copying them first, and Vector and Hashtable no longer look their own parts up by name on every call, nor take a lock no other thread holds or waits for. The bench's string test runs in 70 to 72 percent of the time it took, and its collection test in 54 to 55 percent, with compiling on or off (#129).
  • Compiled game code now makes objects and arrays itself, without handing each one to the interpreter, unless the heap is full and must be collected first. The bench's small object test runs 13 percent faster and its array test 3 to 8 percent. A game that fills its memory gets OutOfMemoryError at the same point as before (#130).
  • FastEmu now compiles a game's methods of up to 2000 instructions, such as its drawing, which stayed interpreted past 500. Those over 500 compile with Cranelift's quicker register allocator, more than twice as fast as the rest, so they hold the game up half as long. Stick Fight takes a little more processor time in its first 40 seconds, while it compiles them, and less after: 27 ms a second against 38 with 0.2.0, for 3 MiB more memory at its peak. Its main loop, of more than 3000 instructions, stays interpreted, since compiling it took 4 MiB more again. cargo xtask bench --interpreted also runs each game with compiling off, to compare the two (#131).
  • Compiling a game's methods no longer holds the game up. The game's thread only checks a method and prepares it, about a tenth of the work, and the machine code is made on a thread of its own while the game goes on. In Stick Fight's first 45 seconds the game's thread waited 28 ms in all for its compiles instead of 361, and never more than 4 ms at a time instead of 33, a whole frame. The game takes as much processor time and memory as before (#131).
  • A game's threads that sleep or wait now wake only when their time is up, when another thread notifies or interrupts them, or when the lock they wait for comes free, not for every repaint, key press or task of another thread. On the Android emulator, Stick Fight's game thread went from one or two such wakes a second to none, with the same frames on screen (#143).
  • On Android and Linux, FastEmu's window sends a game's new frame to the graphics card through memory it reuses, instead of making a buffer for it in every frame, so a frame makes 10 fewer graphics calls. In Block Fall on the Android emulator, making those buffers took a tenth of the window's processor time, and the window no longer does it (#144).
  • The benchmark page gives FastEmu 0.3.0's numbers. On Windows, the bench's call test takes 18.1 ms where it took 60.5, and MicroEmulator's lead in it fell from 26.7 times to 8.0; in its object test it fell from 48.4 times to 11.8. Real games still take 1.2 to 6.0 times less processor time on FastEmu than on MicroEmulator, and show a first frame 3.9 to 7.4 times sooner. The bench now also runs each game with compiling off: with it on, a frame took the same processor time in most games and 1.1 to 1.2 times more in three, and the game held up to 8 MiB more memory at its peak. On Android, J2ME Loader's lead in the call test fell from 51.4 times to 14.7, and FastEmu's app takes 2.2 to 2.7 times J2ME Loader's processor time in games, down from 2.3 to 2.9 (#146).
  • On Android and Linux, a game thread that sleeps reads the clock once a sleep, not three times: the wait now hands the system the time to wake it, instead of asking the time before and after. On the Android emulator each read is a call into the kernel, about 7 microseconds; the processor time this saves there is within the noise of a run, and games draw the same frames (#152).

Get it

System Download
Windows 10 and 11, x64 fastemu-0.3.0-windows-x64-setup.exe: installs FastEmu for your account, with no administrator rights. Or fastemu-0.3.0-windows-x64-portable.zip: unpack it anywhere and run fastemu.exe
Linux, x64 fastemu-0.3.0-linux-x64.AppImage: make it executable and run it. fastemu-0.3.0-linux-x64.deb for Debian and Ubuntu, fastemu-0.3.0-linux-x64.rpm for Fedora and other RPM systems, or fastemu-0.3.0-linux-x64.tar.gz to unpack anywhere
Linux, Arm64 fastemu-0.3.0-linux-arm64.AppImage: make it executable and run it. fastemu-0.3.0-linux-arm64.deb for Debian and Ubuntu, fastemu-0.3.0-linux-arm64.rpm for Fedora and other RPM systems, or fastemu-0.3.0-linux-arm64.tar.gz to unpack anywhere
macOS 11 or later, Apple silicon and Intel fastemu-0.3.0-macos-universal.dmg: open it and drag FastEmu onto Applications. Or fastemu-0.3.0-macos-universal.zip: unpack it and move FastEmu to Applications
Android 12 or later fastemu-0.3.0-android.apk: allow installing from this source when Android asks
Any Linux, sandboxed, x64 fastemu-0.3.0-linux-x64.flatpak: flatpak install ./fastemu-0.3.0-linux-x64.flatpak, which fetches the freedesktop runtime from Flathub the first time
Any Linux, sandboxed, Arm64 fastemu-0.3.0-linux-arm64.flatpak: flatpak install ./fastemu-0.3.0-linux-arm64.flatpak, which fetches the freedesktop runtime from Flathub the first time

First launch on macOS. The app is not notarized: open it once from System Settings > Privacy & Security > Open Anyway, or run xattr -dr com.apple.quarantine /Applications/FastEmu.app.

First launch on Windows. The setup and the program are not signed: if SmartScreen warns, choose More info > Run anyway.

Games. FastEmu does not include any. Add .jar files, with their .jad files when you have them, with Add game in the library. The README tells how.

From a terminal. On Linux and macOS, curl -fsSL https://github.com/fzn0x/FastEmu/releases/download/v0.3.0/install.sh | sh installs this release, checked against SHA256SUMS. On Windows, irm https://github.com/fzn0x/FastEmu/releases/download/v0.3.0/install.ps1 | iex in PowerShell runs its setup.

Verify downloads with SHA256SUMS: sha256sum -c SHA256SUMS --ignore-missing on Linux and macOS, or Get-FileHash on Windows, compared with the line of the file.

Full Changelog: v0.2.0...v0.3.0