Hi, On Thu, Mar 9, 2023 at 4:29 PM Bret Johnson <bretj...@juno.com> wrote: > > The computer I'm currently using is a few years old, old enough that I can > boot DOS on the actual hardware. > The CPU is an Intel i5-4590 running at 3.30 GHz.
* https://www.intel.com/content/www/us/en/products/sku/80815/intel-core-i54590-processor-6m-cache-up-to-3-70-ghz/specifications.html So four cores? But only one core is running under DOS (albeit at max clock speed). But even "Turbo Boost" depends on your motherboard and BIOS enabling it for you. It doesn't go into detail about cache beyond saying "6 MB smart cache". I assume most of that is L3, then some L2, with a very small L1 (usually like 64 kb split between instructions and data ... not sure about writeback). Hey, I'm a noob, but some things are faster than others. The Pentium (586) had 8 kb cache, right? And the 486 was much more sensitive to code alignment. But the Pentium had U and (weaker) V pipes while the 486 was only pipelined. I think the Pentium 2 (686) was when they started adding "out of order" instruction rescheduling. Things like ALU or barrel shifter or register renaming or branch prediction also matter. > I have a DOS program I wrote a long time ago, called SLOWDOWN (and hope to > find time to "update" it in the future). The purpose of SLOWDOWN is to slow > the computer down so that DOS applications don't "blow up" because the > computer is too fast. It's not a perfect solution, but is useful in certain > situations. > > One of the things SLOWDOWN needs to do is figure out how fast the computer is > running so that it can slow it down the correct amount when you want to do > that. So, SLOWDOWN can sort of be used as a "benchmark" to see how fast your > computer actually is. > > For my test, I compared how fast my current computer runs (with a 3.30 GHz > clock speed) against a 33 MHz 386 CPU (which I measured way back when -- I > don't have access to that computer any more). At least in theory, because my > current clock speed is 100 times as fast as the 386, my current computer > should run _at least_ 100 times as fast as the 386 did. Also, at least in > theory, it should be even faster than that since the new computer has a cache > and the 386 didn't, modern CPU's take fewer clock cycles per CPU instruction, > etc. So what instructions are you testing? The original Pentium (586 circa 1993) had a pipelined FPU that Quake utilized in their hand-optimized code. Also, all Pentiums below 120 Mhz had the FDIV bug. Surely some of the slowest instructions are DIV / IDIV. > In fact, the new 3.3 GHz i5 CPU runs about 10 times faster than the 33 MHz > 386 did, not more than 100 times like you would expect. Floppy is always slow, optical drives are slow, virtual memory is slow, etc. Even networking can be slow. USB flash drives tend to be twice as slow to read and five times as slow to write. So a software cache and a RAM disk can help a lot. > I then ran a second test where I disabled the cache on the CPU (you can do > this with my CPUCACHE program which is included with SLOWDOWN). This is a > more "apples-to-apples" comparison of the _actual_ CPU speed than the > original test with the cache enabled. When I did this test, the computer ran > almost exactly the same speed as the 33 MHz 386 (it was about 3% faster, not > 10,000% faster as "logic" would dictate). There is something VERY wrong > going on here. I suspect you may not believe my results, but they are > nonetheless real. Sometimes regressions happen. It's a tradeoff. The Pentium 4 was worse at "inc eax" than "add eax,1". It also didn't have a barrel shifter, so shifts like "shl eax,1" were slower than "add eax,eax". That cpu was deeply pipelined, meant to scale up in raw clock speed (not to mention new SSE2 instructions). Like I said, early P4s were slower than high-end P3s. Newer cpus do usually need a recompile to be maximally efficient (for various obscure reasons). Here I'm also thinking of weird things like (SSE3) FISTTP and (FPU) FNSAVE / FXSAVE, not to mention weird optimizations like "REP RET" or "RET 0". (They also used to say "don't use LOOP, it's slow", but AMD sped it up again.) I've also noticed that some of my (semi-modern) cpus run (186) ENTER much much slower than its 8086 instruction equivalents. Not sure why, maybe they didn't think anyone would use it (most don't anymore, but some old compilers do). > So, given this real-life data, how exactly is what I said untrue, > oversimplified, inaccurate, unrepresentative, or any other similar adjective > you would choose to use? According to the theory, what I said can't be true, > and yet it is. I'm sure somebody will claim something like, "modern CPU's > are optimized for modern applications so you can't expect them to run old > stuff, like DOS, very well." Well, I think it's pretty unreasonable to > expect a modern 3.3 GHz i5 CPU to run at almost the exact same speed as a 33 > MHz 386 and with a straight face say, "it really is more than 10,000% faster > -- you're just not looking at it the right way." As they say, the proof of > the pudding is in the eating. USB emulation in the BIOS can slow things down, too. You might be able to disable that "legacy" support and just use a PS2 mouse and keyboard. (Or not.) > Let me ask you a few questions. One of the things I said was that the main > reason modern CPU's seem so fast is because of "tricks" like pipelining and > caching, and you seem to indicate that you don't think that is true. Would > you even _consider_ running a modern OS on a CPU with the cache disabled, > when the actual, verifiable data shows it would run about the same speed as > in the 386 days? * https://en.wikipedia.org/wiki/Instructions_per_second > The next set of questions relate again to what I mentioned previously. What > if modern CPU's were super high-speed 386-class CPU's? That is, what if we > applied modern fabrication techniques to 386 era technology -- how fast would > the CPU's actually be? Let's assume we could fabricate a 3.3 GHz 386-class > CPU. Do you think it would be 10,000% faster than a 33 MHz 386? I think it > probably would be -- I certainly think it would be WAY faster than my 3.3 GHz > i5. And you could probably fit dozens, or maybe even hundreds, of them on a > single die. AMD's Ryzen just turned six years old last week. It was redesigned from scratch, so it's much better than their previous offerings, no longer "a generation behind". It's very popular, even among the cynical crowd who long ago gave up on AMD. It's used in XBox and Playstation (and at least one MS Surface device). IA-32 is dead. Nobody wants it anymore. Maybe they're only optimizing cpus for 64-bit. Heck, Windows 11 doesn't even have a 32-bit edition anymore, allegedly. Ubuntu long ago dropped 32-bit kernels (but userland still runs). They're all arguing over x86 v3 and v4, not worrying about "legacy". Even ARM64 is prevalent these days. I don't think anyone is going back to 32-bit (for the most part). > Of course -- almost everything is amenable to misinterpretation. Did I > explain it any better this time? > > I fully realize that lots (maybe even all) who read this may think "the > cheese has slid off my cracker" (I love that line from The Green Mile) or > that "I'm not playing with a full deck." That may in fact be the case, but > it could also be that I'm playing with a stacked deck. We may never know for > sure. It doesn't matter. Computers are a complicated mess. None of us understands everything. We're just trying to understand what little bit we can (and hopefully help others along the way). It's okay to disagree. Don't worry too hard about it. _______________________________________________ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel