15 March 2023, 13:13 | #1 |
Registered User
Join Date: Aug 2010
Location: Germany
Posts: 532
|
From the vaults: Why was Workbench 1.1-1.3 so slow when reading disk/drawer contents?
If you have been around long enough, you will remember how slow the Amiga floppy disks were in the days of Kickstart 1.1 through 1.3.
Part of that was caused by the floppy disk drive itself, but there is another reason which you may not know about. That reason also explains why Workbench, and in fact any Amiga program reading the list of directory entries, was slow at reading drawer contents on hard disk drives. The default Amiga file system in Kickstart 1.1-1.3 responds to two operations which perform the directory scanning. First you need to tell it to begin looking at the first entry of a directory, then you ask for the next following entry until the list of entries is eventually exhausted. Directories may contain both directories and files, of course, and each such entry features a name, a modification date and time, a comment (which may be empty), protection flags and an indication of how many disk blocks the respective entry occupies. For directories that number of blocks tends to be 1. For files the total file size in bytes as well as the number of blocks involved to store the file data is counted. Now imagine, if you will, you inserted both your "Deluxe Paint II" boot disk and the "Art disk" into your Amiga floppy drives. Workbench boots up, you open the "Deluxe Paint II" boot volume by double-clicking its disk icon and it takes forever to show one big icon. A closer look shows that the disk does not contain a lot of files, just the usual set of directories for fonts, etc. and icon files for art drawers and the program itself. Why does it take so long to process this? The reason is that it takes longer to examine a larger file when walking through the directory entries than it takes to examine a smaller file. The threshold for floppy disks and hard disk drives which do not make use of the FFS (part of Workbench 1.3) is 35,136 bytes. If a file is shorter than that, it can be examined quickly because only a single block is necessary to learn all about it worth reporting. But if it is longer than that, something peculiar happens. Once a file becomes longer than 35,136 bytes (equivalent to 72 blocks, with a block payload size of 488 bytes) the file system will need extra storage to keep track of the data blocks which make up the file's contents. That extra storage is known as the "file list" (in the original documentation) or the "extension block list" (as per the Amiga Guru Book), and it is attached to the block which contains the file's name, size, etc. When the Kickstart 1.1-1.3 default file system examines a file as part of the directory scanning process, it will walk down the "file list" blocks referenced, loading each from disk and picking up the next one to follow it, as indicated by the contents of the previous "file list" block, pointing to the next chain entry. It is doing so in order to count the number of "file list" blocks. That takes its time. "Deluxe Paint II" is 189,740 bytes in size. 389 blocks data blocks are needed to store it. Of these, 317 have to be managed through the "file list", which consists of 5 blocks. Merely scanning the directory entry thus takes at least 5 times longer than checking out a directory entry of a shorter file. Due to fragmentation, you may have to wait even longer, with the floppy disk's read/write head moving back and forth. Funny thing about all of that: the file system sort of "validates" the "file list" blocks when you are only interested in the name, size, etc. of the file. The extra time spent is also unnecessary. It is possible for the Kickstart 1.1-1.3 default file system to calculate the number of "file list" blocks from the file size alone. Walking down the list, one block at a time, is not even a requirement. In fact, the FFS (Workbench 1.3) does it exactly like that and does not walk the "file list" blocks just in order to to count them. Last edited by Olaf Barthel; 16 March 2023 at 10:43. |
15 March 2023, 14:04 | #2 |
WinUAE 4000/40, V4SA
Join Date: Apr 2020
Location: East of Oshawa
Posts: 538
|
Yet another reason to avoid OFS as much as possible!
|
15 March 2023, 15:17 | #3 |
Registered User
Join Date: Jun 2015
Location: Germany
Posts: 1,918
|
Doesn't that mean that OFS could be patched to avoid this behaviour? What other changes make FFS fast in comparison to OFS?
|
15 March 2023, 15:26 | #4 |
Registered User
Join Date: Aug 2010
Location: Germany
Posts: 532
|
|
15 March 2023, 15:36 | #5 | ||
Registered User
Join Date: Aug 2010
Location: Germany
Posts: 532
|
Quote:
Quote:
Storage blocks are allocated in sequence, if possible. You tell the FFS how much data you need to store and it will try to find the largest sequence of consecutive blocks available to store them. This also has a positive effect on block fragmentation. It's not that great, though, but better than nothing at all. The data structures used for wrangling directory entries are sorted by ascending block order, which means that when reading a directory, the read/write head of your floppy disk drive or hard disk will move only in one direction instead of weaving back and forth. That's a small list of what went into making the FFS more efficient. I probably forgot a thing or two. But the work which went into the FFS in 1986/1987 was worth it. |
||
15 March 2023, 16:35 | #6 |
Registered User
Join Date: Oct 2009
Location: Salem, OR
Posts: 1,770
|
|
15 March 2023, 16:38 | #7 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,233
|
Quote:
|
|
15 March 2023, 17:21 | #8 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
|
Thanks Olaf!
"From the Vaults"... reads like a nice book title Cheers! |
15 March 2023, 19:55 | #9 |
Registered User
Join Date: May 2021
Location: ZZ9 Plural Z Alpha
Posts: 124
|
Really interesting read, many thanks Olaf, really appreciated.
A belated thanks for Term as well, I shudder to think how many hours I spent in front of that on the BBSs Last edited by itsmedoofer; 15 March 2023 at 20:58. |
16 March 2023, 13:00 | #10 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 4,886
|
|
16 March 2023, 19:33 | #11 | |||
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,584
|
Quote:
Quote:
Quote:
There were other inefficiencies too, like the redundant block checksums wasting space and using up CPU time, and all those cli commands that had to be loaded from disk every time they were used. But this just created an incentive for people to find more ways to optimize their disks. Instead of being a chore, it became a game more enjoyable and addictive than many actual games that were pointless exercises in frustration. And Commodore kindly provided one of these 'games' with every Amiga - the Workbench disk! We should have a competition to see who can make their stock 68000 machine with 1.1-1.3 boot off floppy to Workbench and open it to show the icons in the least time. |
|||
17 March 2023, 12:06 | #12 |
Banana
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,214
|
I always wondered why 1.3 was so slow to load compared to later versions.
|
17 March 2023, 12:25 | #13 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 4,886
|
|
17 March 2023, 12:27 | #14 |
Inviyya Dude!
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,774
|
Interesting stuff.
Thanks Olaf... |
17 March 2023, 14:46 | #15 |
Registered User
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 2,000
|
|
17 March 2023, 16:19 | #16 |
Registered User
Join Date: Aug 2005
Location: Skarabörg, Sweden
Age: 44
Posts: 1,020
|
Interesting stuff!
|
17 March 2023, 20:40 | #17 |
Registered User
Join Date: Nov 2022
Location: #Amigaland
Posts: 156
|
I only used WB2.x and up, I did have friends with Amiga 500 though but we rarely used Workbench. But it was an interesting read.
I do remember that I switched to AFS from FFS though. And later PFS, which I still use today. |
17 March 2023, 20:57 | #18 |
Registered User
Join Date: Dec 2020
Location: Italy
Posts: 1,901
|
the optimize option in x-copy have helped me in many cases bitd
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AmigaForever's Workbench 1.3.4 ADF contents | amigasith | support.Amiga Forever | 0 | 10 May 2014 23:10 |
Workbench 3.1 - original disk contents | Bloodwych | support.Apps | 7 | 04 December 2007 18:18 |
How to mount PC drawer in Workbench | DanE | support.Apps | 1 | 22 July 2007 00:56 |
Way too long 'drawer reading' times... | Shoonay | support.Apps | 23 | 31 March 2005 21:38 |
Reading Folder Contents To A Document | Djay | support.Apps | 5 | 17 September 2002 08:26 |
|
|