SheepShaver Performance

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Tycho
Space Cadet
Posts: 6
Joined: Thu Nov 25, 2010 10:25 pm

SheepShaver Performance

Post by Tycho »

Hi everyone. I'm a developer with industry experience in emulation, virtualization and performance optimization. I intend to work on SheepShaver for a couple months and hopefully improve performance by a decent amount. My ultimate goal is to eventually add MMU support to SheepShaver, essentially allowing users to install and run up to Mac OS 9.2.2. If this goes well, I may even work to get PowerPC-compatible versions of Mac OS X running under it. For now, though, speed is my concern. I first looked at PearPC for PowerPC emulation, but it had a few problems. It didn't do what I wanted (run Mac OS 10.5.x, or even 9.x), it ran very slowly, and development is completely dead. I've tried contacting a few of the PearPC developers, but gotten no response in the past year.

The PearPC developers stated publicly that PearPC's slow speed stems from the MMU implementation. To avoid running into the same issue, I'm hoping to improve existing SheepShaver code before approaching the MMU challenge. After all, I don't want to make any bad performance even worse.

I've started evaluating SheepShaver's speed, and I'm rather disappointed with it. It's obviously doing far better at running Mac OS 9.0.4 than PearPC did at running 10.3.x, but it's still awful. The JIT's performance isn't near what one should expect from a JIT. It seems to run at an estimated 30% of host CPU performance, based on numbers from MacBench. If it was done properly, we would see around 90% of host CPU performance (so a 2.66GHz x86 host should be able to run a 2.33GHz PowerPC guest without trouble).

I'm also surprised how slowly the interpreted version runs. Yes, it's interpretation, so it should be slower than JIT, but not to the degree that it is. The interpreter's performance, as measured by MacBench, is approximately equivalent to a 108MHz G3 in the Processor category (most likely integer math, but MacBench doesn't specify), and approximately equivalent to a 120MHz G3 in the Floating Point category. Here are the raw results:

JIT:
Image

Interpreter:
Image

The MacBench numbers seem to indicate that the JIT achieves roughly 5x the performance of the interpreter, at least at CPU emulation. I only measured the CPU performance with MacBench, because the other tests required a CD-ROM with MacBench's test files (which I no longer have a copy of). If anyone has it, please let me know. An ISO would be useful.

I also looked at using Speedometer as a benchmark. It puts the interpreter's overall performance at 7x the speed of a Quadra 605. That's not very impressive, honestly. The JIT's performance was measured at 15x the speed of the Quadra 605 baseline. That's only about 2x the measured speed of the interpreter. It's worth noting that Speedometer factors in more than simply integer and FPU performance, including graphics and disk benchmarks. Those probably heavily impact the overall score, so I will try to address performance issues in those areas as well. Here are the results from Speedometer:

JIT:
Image

Interpreter:
Image

As I work on SheepShaver, I'll make posts either here or on my blog (or both, depending on the response here). I'll show what I've been working on, what's changed and how the changes impact performance. Let me know what you folks think. This should be an interesting few months.
User avatar
ClockWise
Site Admin
Posts: 3960
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang
Contact:

Post by ClockWise »

Hello, and welcome to the forum.

Your interest in improving the emulator would certainly be very much appreciated around here! And please do post about it in the forum... we'd all be very interested in reading about your progress.
dolarfred
Student Driver
Posts: 19
Joined: Tue Jan 01, 2008 10:47 pm
Location: Limoges or Evreux France

Bravo!!

Post by dolarfred »

A lot of person around me wait for sheepshaver improvements,
and still want to use OS9 (and others mac classic system).
An another thing we expect is something like a flash recent player and plug-in
but it seems impossible.

Your interest in sheepshaver is a very good news for all sheepshaver users.

So Thanks for trying to improve it

Dominique
from France
User avatar
Cat_7
Expert User
Posts: 5053
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hi,

We would all surely be very exited by any effort put into sheepshaver and basiliskII. The speed and MMU issues you mention are important issues for SheepShaver to have a future.
If I may mention some other pressing issues from a functionality perspective as well, I would say these are:
-the lack of USB support,
-the sound-in issue,
-flaky CD-rom emulation (f.e. problems with audio cd's),
-no Appletalk through default networking setups.
-application incompatibilities (with e.g. Office 2001)
-video acceleration

Perhaps others can add to this list.

Best wishes, and good luck in your work!
Cat_7

p.s. Where is your blog located? I also wanted to point you to the basiliskII development list (it is used for basilisk and sheepshaver) where you might contact the current maintainers and contributors to the code:
https://lists.sourceforge.net/lists/lis ... lisk-devel
User avatar
24bit
Forum All-Star
Posts: 1409
Joined: Wed Nov 11, 2009 5:47 pm
Location: Germany

Yes please!

Post by 24bit »

Hi Tycho,
all improvements you can achieve, will be very, very welcome indeed!
I have to admit that I didn't think much about SS performance compared to its host system, as SS is the fastest Mac I ever had.
With my old Suse Linux 11.0 hostsystem I got a Norton System Info rating of 1250. (A PM6100/60 as counted as 100.)
Maybe you could run some "Norton System Info" benchmarks as well. Macintoshgarden is hosting the images.
SS seems to use only one core with my AMD X2 64. Maybe you could make some improvements there too.

My favorite host system right now is Mandriva 2010 Spring 32bit. A SS version for Linux 64bit would be great too.

Best wishes!
User avatar
Ronald P. Regensburg
Expert User
Posts: 6346
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

Hi Tycho,

Any real improvement to SheepShaver will be very welcome. So far, I myself did not feel speed to be an issue. Probably because on my Core 2 Duo iMac SheepShaver seems faster than the PPC machines I owned that ran MacOS only.

Additions to list of issues by Cat_7:

- Lack of video 3D 'hardware' that prevents several games to be played
- Limited copying between guest and host system
- In MacOSX: Limited usability of the 'Unix' disk / shared folder
kikkoman
Master Emulator
Posts: 314
Joined: Fri Apr 01, 2005 7:08 am
Location: California, USA

Post by kikkoman »

Ronald P. Regensburg wrote:- Limited copying between guest and host system
Oh, totally. How cool would it be if Sheepshaver had the ability to seamlessly handle drag-n-drop between host and guest systems (with a pop-up alert for long file names or non-traditional characters) and all the while, have the ability to retain the Classic Mac file's data fork (if the Host is a Winblows PC).
Tycho
Space Cadet
Posts: 6
Joined: Thu Nov 25, 2010 10:25 pm

Post by Tycho »

I might or might not add major features. Not sure yet. My primary focus is performance and then MMU support for SheepShaver. Once that's working, I could probably tinker with graphics acceleration. That's not a certainty yet, though.

Regarding networking... AppleTalk should theoretically work fine over tap. Are people having trouble getting AppleTalk working via tap? Or is it just a matter of tap not being the default? It shouldn't be difficult to make it the default on any platform. It's just a matter of packaging it so that the installer does the proper prep work to make tap work properly.
User avatar
Cat_7
Expert User
Posts: 5053
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hi,
Thanks for clarifying your intentions.

Tap networking works, in OSX, Linux and Windows hosts. But, to get to work in OSX for now, you need to start SheepShaver as root to start the tap driver (it only gets created when running as root), and need to use 3rd party software to bridge connections. I'm almost sure there should be a simpler way to use the OSX tools to bridge the connections. There is a manual here:
http://www.emaculation.com/doku.php/app ... heepshaver

Appletalk networking also works in Windows with the Basilisk ethernet driver, but it crashes SheepShaver during Mac OS startup when there is any network traffic on the host when Mac OS starts networking. A solution is to disconnect the cable just before starting SheepShaver and reconnecting after Mac OS has started.
Please see the guide here:
http://www.emaculation.com/doku.php/app ... er_windows

And in Linux, some complex configuration is needed with the sheep_net driver, or configuration for a tap device. The old script that should set up things doesn't work anymore.

SheepShaver also has some 32/64 bit problems: f.i. the cdrom driver (cdenable.sys) for which I believe no source code is available is only 32 bit and might be replaced with windows code, so that the dependency is removed?

Best,
Cat_7
Tycho
Space Cadet
Posts: 6
Joined: Thu Nov 25, 2010 10:25 pm

Post by Tycho »

Yes, you have to be a superuser in order to configure the tap device, and that does complicate matters. It's possible to have a very simple separate tool which will do the superuser's job and configure the tap device for you. Then, to make it easy to run, you can either make that executable setuid root (not necessarily preferable) or run it via sudo. Once the initial setup is done, the tap device becomes accessible to regular users.

It's worth noting that trying to get AppleTalk working on anything but tap is probably going to be wasted effort. Tap is simply the best way of doing proper guest networking. Lots of open source emulators use it (bochs, QEMU, PearPC, etc), and it's not horribly complicated to use. I think the reason tap isn't the default is simply because it isn't a zero configuration network setup.

Also, wow, the AppleTalk-related crash you mention seems ridiculous. That should really be debugged and fixed.
fanman93
Granny Smith
Posts: 145
Joined: Wed Nov 11, 2009 10:05 pm
Location: Canada

Post by fanman93 »

Hi!

I have to say, it's nice to see every once in a while someone stepping up to the plate with stuff like this. MMU is a very major feature, in my opinion, since it could (in theory) allow the booting of the original OS X, which PearPC can't do. But beside that, more applications for OS 9 could be run with the addition of 9.2.x. This would be very welcome in the emulation community!
User avatar
ClockWise
Site Admin
Posts: 3960
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang
Contact:

Post by ClockWise »

So as you can see, Tycho, there is lots of interest in your ideas on this forum! :)
Miah
Space Cadet
Posts: 2
Joined: Tue Nov 30, 2010 7:52 am

Post by Miah »

Hey there, I'm a contributing developer to this resurrection. Didn't see this post before, heh.
fanman93 wrote:MMU is a very major feature, in my opinion, since it could (in theory) allow the booting of the original OS X, which PearPC can't do. But beside that, more applications for OS 9 could be run with the addition of 9.2.x.
This is part of why this is tasty to us. But while we're on the subject of things that are welcome, let me note another goal (at least one of mine). I have large issues with rolling back system versions too far. I had just tried to install 7.5 with a rather spectacular failure, but my intention is to debug for rollbacks to system 6 and possibly further depending on how much work this would take and how well received it is.

I have a fair amount of programs from my childhood on ice that not even 9.0.4 will run, so there's some motivation there.
User avatar
Cat_7
Expert User
Posts: 5053
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hi, and welcome too!

Very nice to see interest rising in reviving SheepShaver and BasiliskII development.
You are investigating supporting older systems with BasiliskII or primarily with SheepShaver?

Best wishes,
Cat_7
User avatar
Ronald P. Regensburg
Expert User
Posts: 6346
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

Hi Miah, better discussing in the forum than in private messages. :wink:

The first PPC Mac (Power Macintosh 5200) had a PowerPC 603 processor and came with System 7.5.1 (plus System Enabler 406) installed. So I doubt that System 7.5 can run in SheepShaver. Anything earlier than 7.5 will run on a 68k Mac only. (SheepShaver emulates a PPC Mac and BasiliskII emulates a 68k Mac.)
Mike_
Student Driver
Posts: 20
Joined: Sat Oct 24, 2009 4:21 pm
Location: Bremke, Germany

Post by Mike_ »

Ronald P. Regensburg wrote:...The first PPC Mac (Power Macintosh 5200) had a PowerPC 603 processor and came with System 7.5.1...
I beg to differ here: The first PM (6100) had a PowerPC 601 processor and came with System 7.1.2 + PowerPC Enabler v1.0.
User avatar
Ronald P. Regensburg
Expert User
Posts: 6346
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

Yes, you are right and I was wrong.
User avatar
24bit
Forum All-Star
Posts: 1409
Joined: Wed Nov 11, 2009 5:47 pm
Location: Germany

System7

Post by 24bit »

Anyway SheepShaver won't run 7.1.2 as far as I can tell.
But if you would like to see 7.5 again, SheepShaver does run 7.5.3 Revision 2.2 .
See System Recovery 1: "7.5.3-PM 9500 folder", if someone wants to try it.
Guess, you were all aware of that.

The default System installation will only take about 14 MB RAM and seems to benchmark very fast.
yksoft1
Master Emulator
Posts: 392
Joined: Tue Aug 14, 2007 4:32 pm
Location: People's Republic of China

Post by yksoft1 »

I ran MacBench 5.0 on Sheepshaver for Windows (code cloned from CVS in April 25, built using MinGW GCC 3.4.5) under my Core Duo T2300e (1.66GHz, 667MHz bus) PC.
with JIT:
Image
without JIT:
Image
for SheepShaver I thought it couldn't do multithreading properly and the drawing speed of libSDL under Windows limited its speed a lot...

I also ran MacBench 5.0 on my old iBook 500MHz Dual USB (slower than PowerMac G3 300MHz due to 66MHz bus speed?)
Image
Last edited by yksoft1 on Thu Dec 02, 2010 9:53 am, edited 1 time in total.
yksoft1
Master Emulator
Posts: 392
Joined: Tue Aug 14, 2007 4:32 pm
Location: People's Republic of China

Re: System7

Post by yksoft1 »

24bit wrote:Anyway SheepShaver won't run 7.1.2 as far as I can tell.
But if you would like to see 7.5 again, SheepShaver does run 7.5.3 Revision 2.2 .
See System Recovery 1: "7.5.3-PM 9500 folder", if someone wants to try it.
Guess, you were all aware of that.

The default System installation will only take about 14 MB RAM and seems to benchmark very fast.
In my experience just copying 7.5.3's "System 7.5.2 Update" enabler over to an existing 7.5.1 system folder make it run in Sheepshaver...
andreas_g
Student Driver
Posts: 18
Joined: Thu Dec 02, 2010 5:50 pm
Location: Austria

Post by andreas_g »

Tycho, thank you for your work!

I think that improved speed and MMU support is exactly what SheepShaver needs most.
It would be great to be able to run Mac OS 9.2.2 and would be even greater to be able to run PPC Mac OS X!

In addition to speed and MMU support there is another thing that would be a great improvement for SheepShaver (and could get important when trying to run Mac OS X):

Emulation of EIDE or SCSI bus!

For now SheepShaver treats all volumes as large floppies. I'm not sure if Mac OS X can be installed on such a volume, but at least with Rhapsody/Mac OS X Server 1.0, the predecessor of Mac OS X, this is not possible.

So maybe after reaching you primary goals you find some time to implement this.
One thing is for sure ... these are exciting times for users of SheepShaver!

With best regards,

Andreas
Miah
Space Cadet
Posts: 2
Joined: Tue Nov 30, 2010 7:52 am

Post by Miah »

andreas_g wrote:For now SheepShaver treats all volumes as large floppies
Just ran across this minutes ago. Tycho thinks it's hilarious. I generally disapprove.

But yes, we'll need to address that one. Explains some of the oddities I ran across earlier, though.
kikkoman
Master Emulator
Posts: 314
Joined: Fri Apr 01, 2005 7:08 am
Location: California, USA

Post by kikkoman »

I really didn't want to dig up this old topic, but did anyone manage to get the address to Tycho's blog? Or even more importantly, if anyone has any word on what progress he's made (if any)?
Amade
Tinkerer
Posts: 63
Joined: Thu Feb 18, 2010 10:09 pm

Post by Amade »

User avatar
Cat_7
Expert User
Posts: 5053
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hello,

I tried to build the source code linked to in the previous post in VC2008, after installing SDL 1.2.14 and DirectX SDK 2010. It looks promising!
The compiler runs into problems in the linking phase (below is an error). Perhaps my build tools are not sane enough yet? Does anyone know?

Best,
Cat_7

ppc-decode.obj : error LNK2019: unresolved external symbol "private: void __thiscall powerpc_cpu::execute_vector_arith<struct op_template_xor<unsigned __int64>,struct v2di_operand<struct bit_field<6,10>,unsigned __int64>,struct v2di_operand<struct bit_field<11,15>,unsigned __int64>,struct v2di_operand<struct bit_field<16,20>,unsigned __int64>,struct null_vector_operand,struct fake_bit_field<bool,0>,0>(unsigned int)" (??$execute_vector_arith@U?$op_template_xor@_K@@U?$v2di_operand@U?$bit_field@$05$09@@_K@@U?$v2di_operand@U?$bit_field@$0L@$0P@@@_K@@U?$v2di_operand@U?$bit_field@$0BA@$0BE@@@_K@@Unull_vector_operand@@U?$fake_bit_field@_N$0A@@@$0A@@powerpc_cpu@@AAEXI@Z) referenced in function "void __cdecl `dynamic initializer for 'private: static struct powerpc_cpu::instr_info_t const * const powerpc_cpu::powerpc_ii_table''(void)" (??__E?powerpc_ii_table@powerpc_cpu@@0QBUinstr_info_t@1@B@@YAXXZ)
Post Reply