On Friday, January 25, 2019 at 3:38:54 AM UTC-8, tpear wrote:
> As a matter of interest, is there any rough idea as to how well the emulator performs compared to a real PERQ? So long since I saw one (and then only briefly) I’ve no idea lol
>
While focusing on emulation accuracy, I haven't done any real measurements of performance. Because there's no speed regulation in the current emulator, the easiest way to gauge your particular computer's performance is by booting POS and watching it update the clock in the main window's title bar. If the clock ticks once per second, you're golden! :-)
The wristwatch/eyeball test shows that my 8-core, 2.8Ghz Xeon (Mac w/Mono 4.6.1) runs the emulated PERQ at around 66-75% of the real hardware. But my 3.06Ghz dual-core iMac (Mono 5.0.x) doesn't appear to be appreciably faster. On my son's overclocked 5.1Ghz gaming rig under Windows 10, the emulator runs at about 120-150% faster than the baseline 5.89Mhz PERQ. I had to give up on my PowerMac G5 and Solaris/SPARC machines because Mono support really dried up after 2.10.x, and it's hopeless to bother running on any non-x86/x64 CPU at this point. "Cross-platform. You keep using that word. I don't think it means what you think it means..."
I've spent a few months looking at ways to increase performance, reduce GC overhead, and effectively rate-limit the emulator to match the 170ns microcycle time of the original hardware. Without rendering the display, the emulated microengine can run at around 48ns up to around 139ns, depending on Debug flags, optimizations and the weird behavior of the various Stopwatch/Timer functions in C# introducing odd delays of their own. So even on my 2009 Mac, there's more than enough headroom to run the PERQ CPU at speed. Nearly all the sluggishness comes from Mono/WinForms being painfully slow at drawing the PERQ's display at 60fps.
I've got test programs that run like a bat out of hell but leak like a sieve and crash if you try to actually do any work besides just blasting frames to the display. I've tried about a hundred different approaches and have ended up utterly dismayed by the state of the .NET/Mono UI world. There are 50 options and all of them are incompatible, already obsolete, not cross-platform, or just flat out broken. But this week I possibly found a suitable cross-platform solution that will seemingly let the display run at 60fps without swamping the host computer, and still let me use generic WinForms controls to expand the GUI (even on Mono) to include a new debugger, a dynamic configuration tool (so you can adjust memory, display, IO options, etc) and some other fun features. So maybe approach #51 will do the trick? I'll post updates as "real life" allows...
In the meantime, the amazing Josh Dersch has released both his excellent Xerox Alto emulator (see: ContrAlto on Github) and now his latest Xerox Star emulator (see: Darkstar on Github). LOTS of excellent stuff in there -- like Ethernet support! -- that will find its way back into PERQemu in time. :-)
> I wonder if the various PERQ OSs have much in the way of dependencies on the real PERQ timings - whether a fast emulation makes it have better performance or if the altered timing might make it unusable.
There aren't too many places in the PERQ code that were timing dependent as far as I can tell. There were a few hardware cases where the microcode would have to wait a few cycles for specific setup/hold times, or rely on index pulses from the disk to initiate track formatting, and stuff like that. Right now I don't really have a machine that's too fast to test on, but if I did it'd be to test the rate-limiting code and try to lock it in at 5.89Mhz! Of course, it might be fun to allow a configuration option to allow overclocking your virtual PERQ. :-)
That would also be handy for when I need to do a "build world" for recompiling POS (about 10 hours real-time), or bootstrapping a new disk image from scratch... and that's with the emulated Shugart disks running much faster than the actual drives...
> BTW - is there a simple way to turn the floppy images on bitsavers into something readable by the emuloator? Otherwise that’ll be another little personal project for my backlog lol
Ah, yes. I've been working with Josh to archive the rest of my floppies that aren't on Bitsavers, and to convert the older .raw and .dmk/.imd format floppy images to PERQemu's format. In the coming weeks I'll try to expand on the PERQmedia archive on Github with a whole slew of floppy images and the programs to convert 'em. This would all go a lot faster if I wasn't getting dragged away for weeks at a time on remodelling jobs, but an extra $6/month raised through Patreon probably wouldn't be enough to let me devote more time to PERQ stuff and still pay the mortgage, or eat something now and then. Sigh. :-/
-- c