techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

5.4K
active users

Jim Luther

I noticed the retro Mac community was working on and although I'm not working on anything, I thought I'd contribute this suggestion: If you're using AppleShare on Mac OS 7.6 or later, you might want to use the AppleShare client extension that shipped with Mac OS 9.2.2. That's AppleShare version 3.9.2.

One of the last things I worked on in Mac OS 9 was the AppleShare client that shipped in Mac OS 9.2.2. The AppleShare team had moved on to work on Mac OS X and because I'd supported AppleShare while in Developer Technical Support and had worked on the AppleShare client for Mac OS 9.0 to make it work with the File Manager changes in 9.0, I got the job.

The bug I was given to fix was poor Finder performance when a user opened multiple directories simultaneously on an AppleShare volume. However, after fixing that bug, I kept going. :)

What follows in this thread is a list of things I changed:

1/5 🧵

* I added multiple AFP enumeration caches (16 of them) so when multiple directories are simultaneously being enumerated with GetFInfo or GetCatInfo, those enumerations were not throwing out each other's data. This was the bug I was supposed to fix.

* I noticed the enumeration caches were small (512 bytes) -- the same size they'd been since 1987 when memory was very tight on a Mac. I increased size of those enumeration caches. The result is enumerating larger directories is done with fewer transactions with the server.

2/5 🧵

* I made MakeFSSpec much faster. When System 7.0 first shipped, I got a developer bug that showed MakeFSSpec (new in System 7) was very slow on AppleShare. I filed a bug for the developer and even explained what the problem was. The code would enumerate a directory to find a matching filename to the filename passed to MakeFSSpec. If the filename was the last to be seen in a directory enumeration, that resulted in many transactions. With my rewrite, making an FSSpec is accomplished with only one or two transactions with the server. This bug effected creating FSRefs, too.

* Increased size of response buffers used for ATP to hold 8 full-sized ATP response packets (it was 1) to increase network performance (reduce the number of transactions with the server). Why was it so small? The code had not changed since 1987.

3/5 🧵

* I replaced routines that moved blocks of memory 1-byte at a time in loop with calls to BlockMoveData for improved performance. Someone at sometime thought BlockMove/BlockMoveData couldn't be called at interrupt time and added that slow memory copy routine -- they were wrong.

* I replaced BlockMove calls with BlockMoveData wherever possible (BlockMove was only needed when moving code) for improved performance.

* I locked out loading on Mac OS versions earlier than 7.6 (this version of AppleShare was only tested with Mac OS 9.1/9.2.x but it should work back to 7.6). That's because code in the AppleShare client had required features only in 7.6 and later.

* I removed dead pre-System 7.6 code (much of it still ran during initialization but did nothing).

4/5 🧵

* I replaced multiple INIT resource with a single INIT resource that loads the other code (now in CUST resources) in the correct order. If the AppleShare client was edited with a resource editor on Mac OS 9.1 or later, those INIT resource might have loaded in the wrong order.

* Fixed a few other random bugs I saw that probably wouldn't be noticed by anyone else but they bugged me.

5/5 end of 🧵

From the 9.2.2 CD

@jimluther that sounds like an incredibly satisfying set of changes

@atax1a It was! I was in a very small group tasked with improving performance and stability from 7.5.5 through 9.2.2. We fixed bugs wherever they popped up if there was nobody already working on that code (mostly non-UI code). We also helped other teams find and fix those kinds of problems.

@jimluther thanks for your work and for sharing your stories :)

@jimluther @atax1a - Jim, this is a fascinating thread. Thank you for sharing your story and these details.

Do you suppose that if everyone hosting files on real Macs ran System 7.6+ with the 9.2.2 AppleShare client, and every user participating in #globaltalk did the same thing for themselves as a client, would this have a measurable impact on responsiveness of browsing shares and file transfer throughput on #globaltalk? The best transfer speed I've seen so far are about 16 KB/sec, and of course folders take ages to load.

Hosting virtual Apple Internet Routers via QEMU and UTM has helped a lot. A virtual Quadra 800 running on Apple Silicon can process packets a lot faster than any real 68K or low end PPC ever could.

@theirongiant @atax1a At the time, I was measuring performance gains on local AppleShare servers, and those gains were great.

Those changes to enumeration and creating FSSpecs/Refs make reading directories much faster -- especially when multiple directories are being read at the same time which is what happens if you copy of directory that contains subdirectories.

Those changes and the ATP buffer changes also reduce the number of network transactions. Over the internet, that makes a HUGE difference because of network latency (ping). Here’s an example. By making the ATP buffers 8x larger, there are up to 8x fewer transactions when copying a file. If the connection to a server has 100ms ping… well, you can do the math to see that reducing transactions can remove LOTS of time.

@theirongiant @atax1a if anyone tests performance using the last client with my changes against an old client over an internet connection (not a local connection), I’d be interested in the results. The higher the ping to the server, the more difference it should make.

@jimluther

...were you a Blue Meanie?

(I never worked at Apple, just heard bit about the org back then)

@dgentry Nope. The Blue Meanies group was around from before System 7.0 to maybe just before 7.5. I was in the Developer Technical Support during that time, and joined the System Update team (which became Mac OS Release Engineering after Copland was cancelled) just as 7.5.3 was being wrapped up.

@jimluther Any chance we could get you for an interview to talk about your time at Apple? Retro Repair Roundup would love to have you on!

Thanks,
Ron

@jimluther What a great read! Wow thanks for sharing this story! And for that work!

I love when you can just pick “modern” extensions and bring them back to older Mac OS versions.

I’m also amazed you recalled that with so many details, I can’t even remember things I worked on 5 years ago, haha.

@pierrenick Apple used to pay much more attention to backwards compatibility. However, getting the testing resources to test changes on older systems is hard, so that's why it isn't done as much as everyone would like.

The AppleShare extension code I changed had been tested with systems back to 7.6 (at least I was told that) and the changes I made to the AppleShare extension did not depend on anything new, so I feel fairly safe saying the AppleShare extension v 3.9.2 will work with Mac OS 7.6.

@atlauren That probably deserves another thread. The short version of that story is…

I was the engineer working on webdavfs from the end of Mac OS X 10.1 through the 10.4 updates. I left the Mac OS X file systems team right as 10.4 shipped because I was told that none of the things I wanted to improve in the code were going to be approved, and I’d be assigned to work on other things.

What made the Finder *seem* slow was a limitation of HTTP. Entire files that had been written to had to be pushed up to the server with a PUT request when the file was closed. That time of pushing an entire file up to the server when a file had been written to and closed is what made the Finder seem unresponsive.

1/2

@atlauren Anyway, after I quit working on webdavfs, it never really got any faster but we came up with a way for webdavfs to communicate with the Finder to show progress during close on the PUT request to the server. Bill Conway, who had taken over responsibility for webdavfs and implemented that change in webdavfs. The Finder team showed that progress during close to let the user know something was happening during file copies.

Sometimes showing something is happening in UI makes users *think* things are faster 😀

2/2

@jimluther So I kinda want to know how much of this did you remember off the top of your head and how much was in notes you had? I don't have codebases I've worked on quite that old YET (its only a decade and a half) but it stuck with me a lot longer than I thought it would when I wrote it.

@tevruden Engineering usually sent notes to DTS for what became Technical Notes like this one developer.apple.com/library/ar

There was no 9.2.2 Technical Note. Otherwise, I would have just pointed at it (although the details of why the AppleShare client was faster, or used less network resources wouldn’t have been noted).

I remember the changes I made to AppleShare because it was one of the last things I did on 9 and because the performance differences for some operations were so great. (the last 9 code I changed had something to do with how package directories were recognized - I don’t remember any details about that change)

developer.apple.comTechnical Note TN2010: Mac OS 9.1TN2010.

@jimluther I don’t remember what I did back then, you must keep good notes ! :-) thanks for sharing

@jimluther amazing story, thanks for saving the world countless cumulative hours of headaches with your hard work!

As a developer/maintainer of #netatalk I use the final OS9 AppleShare client as my reference point when making sure we don’t break AFP 2.2.

We’ve had to do a multitude of workarounds for bugs in earlier “classic” versions of the AppleShare client. It’s been an emotional roller coaster ride. :)

@jimluther this is such a fascinating thread. Thank you for sharing.