From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9412 invoked from network); 13 Dec 2022 15:54:12 -0000 Received: from minnie.tuhs.org (50.116.15.146) by inbox.vuxu.org with ESMTPUTF8; 13 Dec 2022 15:54:12 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id BE483423F9; Wed, 14 Dec 2022 01:54:06 +1000 (AEST) Received: from mail-vk1-f177.google.com (mail-vk1-f177.google.com [209.85.221.177]) by minnie.tuhs.org (Postfix) with ESMTPS id A87E4423F4 for ; Wed, 14 Dec 2022 01:54:02 +1000 (AEST) Received: by mail-vk1-f177.google.com with SMTP id f24so1745546vkl.9 for ; Tue, 13 Dec 2022 07:54:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20210112.gappssmtp.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=A4sw/Nq/jEda4F4+yUWH1prrvHdjIIt/T4/FcJJEDC0=; b=Qf7yxCtq5DbHpY4YCIvewIhvOcubN1tJhMZL3nPa7AZewJqtME5t8yQN99s6VZsfz1 x6BvutngPS6bYVc/ZASvm6nCtJNlR8CG8fbjwjkc/M1eOIuqmQK8wEbsc+2BtZ7j9VEO HgMo3K0kETO9ZYNc4QjqmdGfU5gIgGwK7u4J3uXomNb0Ibz1eOQbBG5xcHplO7SWuYsY NYNlByyXDmx390Z6N4bsjrsozC+1ZuvHHTgCGteHRJu7pEcsLKzjMr44ZDbMZtvna7MY jxGY6gKQ1pi2Rq6qtzdjSZXcVmRBV034C6kZDS3cwQcmbX3Mk509BK9QSfNGPYkaUDFq bldg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A4sw/Nq/jEda4F4+yUWH1prrvHdjIIt/T4/FcJJEDC0=; b=qH9K1XE4PI+wZYcOGVDqVXodV+FRQ1W3YPlJiSbU500P/fKmC+uqpZiq0WlgatwD60 aqawqnHIIRsxzG0fHlX4j662lBQHuMo49v9ongdhVlVMwhuyHmrcOZpwppWGrOjm3Ck5 r9T39aCCbonYRIVTH1pWPV0Vzh8YPptUbZ/7p1+NoXGiWtEnSg8gt/4x0b0mP2GYJw3X 8BGMTSf2lqTsAyj0LZu8cU7yEDEUdb11GZEyQegZMqJblYK+sAhjxj65X0GkBYvKcBoz heqpWgzZD6ZqjOUzSCsRHzKHNPaFca2Pb7WIYSAD84ETJMBbGC/TpFqjRQi89Y9nR5ij 3N7g== X-Gm-Message-State: ANoB5pktjHGQxOnaex5q1+s0nZC4WXMk8ja8nXZkxx6hSBSVZn7aKnDK 4GxQzR9o/luIzmbcy41atCROsnRuHnOMZRjP X-Google-Smtp-Source: AA0mqf5WqfIuLH6Yr/NtMBVDCBHafyzgZ3d2YRZVsvG6lm+sIM7IKO0MOUQe/tFH1OzlozmUiN2nhA== X-Received: by 2002:a1f:b406:0:b0:3c1:908:9719 with SMTP id d6-20020a1fb406000000b003c109089719mr4132295vkf.16.1670946781566; Tue, 13 Dec 2022 07:53:01 -0800 (PST) Received: from smtpclient.apple (107-215-223-229.lightspeed.sntcca.sbcglobal.net. [107.215.223.229]) by smtp.gmail.com with ESMTPSA id de36-20020a05620a372400b006fae7e6204bsm8048186qkb.108.2022.12.13.07.53.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Dec 2022 07:53:01 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) From: Bakul Shah In-Reply-To: Date: Tue, 13 Dec 2022 07:52:49 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <29888CC6-CA23-4361-BC9C-1B8A775C8DA9@iitbombay.org> References: To: Rudi Blom X-Mailer: Apple Mail (2.3731.200.110.1.12) Message-ID-Hash: HNAYUO55X7REPSGUHUHTNZQMY5EDUWUU X-Message-ID-Hash: HNAYUO55X7REPSGUHUHTNZQMY5EDUWUU X-MailFrom: bakul@iitbombay.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-tuhs.tuhs.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: tuhs@tuhs.org X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: Clever code List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Dec 12, 2022, at 7:30 PM, Rudi Blom wrote: >=20 > I vaguely remember having read here about 'clever code' which took = into account the time a magnetic drum needed to rotate in order to = optimise access. Similar consideration applied in the early days of unix workstations. Fortune 32:16 was a 5.6Mhz machine and couldn't process 1020KB/sec (17 sectors/track of early ST412/ST506 disks) fast enough. As Warner said, one dealt with it by formatting the disk so that the logical blocks N & N+1 (from the OS PoV) were physically more than 1 sector apart. No clever coding needed! The "clever" coding we did was to use all 17 sectors rather than 16 + 1 spare as was intended. Since our first disks were only 5MB in size, we wanted to use all the space and typical error rate is much less than 6%. This complicated handling bad blocks and slowed things down as blocks with soft read errors were copied to blocks at the very end of the disk. I don't recall whose idea it was but I was the one who implemented it. I had an especially bad disk for testing on which I used to build V7 kernels.... > Similarly I can imagine that with resource restraints you sometimes = need to be clever in order to get your program to fit. Of course, any = such cleverness needs extra documentation. One has to be careful here as resource constraints change over time. An optimization for rev N h/w can be a *pessimization* for later revs. Even if you document code, people tend to leave "working code" alone. > I only ever programmed in user space but even then without lots of = comment in my code I may already start wondering what I did after only a = few months past. Over time comments tend to turn into fake news! Always go to the primary sources!=