ASCII by Jason Scott

Jason Scott's Weblog

The Need for JSMESS Speed —

This is another call for help with JSMESS. I promise you that I will get back to more general computer history soon, but this project is really important and changing the entire paradigm of how software is presented is pretty high up the list right now.

I also know this description of the issue and then calling out for help can get pretty repetitive, but the combination of javascript conversion, browser interaction, and the entire MESS/MAME project itself means there’s all sorts of strangeness happening in the gaps between.

Let’s focus on the good part first… This program works very well. Almost miraculously, it will run a whole variety of software, game cartridges, and images and present them inside of your browser. Sometimes it’s a bit rough, sometimes it’s a bit slow, sometimes the mere overwhelming user interface between the original item and it being in a browser window makes things strange. But even a few years in, I will set up a full screen image of a game console playing a scrolling classic and I will completely forget how this is happening. It is seriously the bomb.


A while ago I put out a call to have the sound issue looked at. A top-notch developer named Katelyn Gadd stepped forward, helped us create an entirely new sound device, and in doing so fixed about 20 major problems with sound. She also gave all of us a master class in understanding what the boundaries and hurdles are in browser sound in general. Summary: lots, although they are working to change standards to make it better.

The sound situation and resolution was amazing enough to inspire me to try it again. This time, it is speed.

There are a variety of attacks to making the JSMESS system run faster in the browser.

Obviously, it helps if the Emscripten language compiler gets more efficient, and work is being done in that direction. Just a year ago (can it have really been just a year?), The Colecovision emulation was working at 14% speed. Now it almost always consistently runs at 100% on even slower systems. Work on this is ongoing, and the Emscripten development team stays in almost constant communication with us, so that’s being handled.

Obviously hardware will get better over time, but we’re not exactly going to sit back and wait. But stay on point, computer industry!

The browsers themselves are rapidly increasing the speed of their JavaScript engines. The website lets you watch nightly tests being run against JavaScript engines so that we may notice that these things are getting damn fast. Again, not my department, not willing to wait.

Certainly, the emulator itself has been working to speed things up, but it might not surprise you to learn that speed is willingly sacrificed in the name of accuracy, to make sure that all the aspects of incoming images are handled and that everything can be, if not future-proof, at least future-existent. If it slows things down for a while, the MAME/MESS team is not bothered by it. It would be nice if somebody went to work on the emulation team itself to optimize things and generally help track stuff down, but that’s a rant for a future entry. Until then, speedups and slowdowns on the emulation can have a pretty drastic effect on the JavaScript version as well.

So that leaves a number of efforts to make the resulting JavaScript output as machine friendly and fast as possible. It also means a situation where simple code changes applied to the emulator source code results in the JavaScript versus being that much more efficient.

To help jumpstart things, we have created a page about the need for speed. We’re trying to put, in terms that will be of use to a developer or coder, what exactly were looking for.

If you’ve got the skills to get involved with this, or know someone who does, it would be great to hear from you. It would have an amazing effect on a pretty important project, and we’ve seen cases where one or two simple insights from a new team member makes the entire thing run that much better.

We really come along. There’s a ways to go, and I’m hoping that by writing this we can reach out to someone to make a difference.

Let’s speed this thing up.


Categorised as: computer history

Comments are disabled on this post

One Comment

  1. daggar says:

    Good god man. I knew JSMESS was coming along, but that game you linked to blew me away.

    Emulating a Genesis in Javascript at anything near real-time was something I would have guessed wouldn’t be possible in five years, much less today.

    Unfortunately I have no leads for you, but I’ll keep my ears open. Keep up the good work and forward my compliments to the rest of the JSMESS team.