|
|
Eddy Vluggen wrote: Note the #1 in all tests.
Thank you. I will test it it.
And C Language seems to be a great choice. Or Golang. Or Rust.
|
|
|
|
|
C because it close to assembly. Golang or rust aren't competing there.
If it is a core function of what you do, then it'd make sense; eliminate the dependency.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Machine code generated from Rust usually levels with C in terms of raw performance, often outperforming it
|
|
|
|
|
Sure.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I'd be interested to learn why "rust isn't competing here".
|
|
|
|
|
It's a LLVM.
Running in a fictional machine.
On top of a real machine.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
LLVM is not a VM, but a (native) language compiler.
Rust compiles to native code just as C and C++ do, and it uses LLVM as the compiler back-end.
Rust will frequently be faster that C or C++ for implementing the same algorithm, and sometimes a bit slower.
|
|
|
|
|
You got a really weird number at String.IndexOf. Here are my results:
Elapsed Time for [String.Replace]: 16,8695848 sec
Elapsed Time for [String.IndexOf]: 2,0153508 sec
Elapsed Time for [String.SubString]: 11,7445885 sec
Elapsed Time for [String.Remove]: 10,1579051 sec
.NET 6 is 1.7x up to 2.9x faster.
I think these numbers are pretty consistent.
|
|
|
|
|
Prior to .NET 5, culture-specific comparisons used NLS[^] on Windows. Since .NET 5, they switched to using ICU[^] instead.
Globalization and ICU | Microsoft Docs[^]
There is a config switch to force .NET to use NLS instead, but it's not recommended:
Breaking change with string.IndexOf(string) from .NET Core 3.0 -> .NET 5.0[^]
If you change your IndexOf call to specify StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase , the .NET 6 code is roughly 1.5x faster than the .NET Framework 4.8 equivalent.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
likly this. core 3.1 default basic just fine, and then 5.1 is playing a different sport.
This sounds like same issue with defaults switching from Newtonsoft JSON to System.Text that Text uses case sensitive name matching
[Replace]: [IndexOf]: [SubString]: [Remove]:
core 3.1 run 1 21.7278133 sec 1.7657007 sec 10.897253 sec 7.2913159 sec
core 3.1 run 2 17.5640173 sec 1.4541324 sec 8.3179752 sec 6.0721578 sec
core 5.0 run 1 14.7799258 sec 20.315649 sec 7.6012973 sec 5.9379139 sec
core 5.0 run 2 15.2000948 sec 26.041709 sec 10.142171 sec 7.3596202 sec
core 6.0 run 1 10.7217398 sec 18.049464 sec 7.5585288 sec 7.5387282 sec
core 6.0 run 2 10.6481228 sec 17.215285 sec 7.5210471 sec 6.4885804 sec
fw 4.8 run 1 33.0995089 sec 1.7132278 sec 9.5126196 sec 6.9524378 sec
fw 4.8 run 2 28.0019003 sec 1.4240000 sec 7.9734736 sec 5.6638693 sec
|
|
|
|
|
I can reproduce the nature (if not the exact numbers) of these results using BenchmarkDotNet and the same code being benchmarked (i.e. the loop bodies). I added a fifth benchmark for IndexOf with StringComparison.Ordinal .
// * Summary *
BenchmarkDotNet=v0.13.1, OS=Windows 10.0.18363.2274 (1909/November2019Update/19H2)
Intel Core i9-9980HK CPU 2.40GHz, 1 CPU, 16 logical and 8 physical cores
.NET SDK=6.0.202
[Host] : .NET 6.0.4 (6.0.422.16404), X64 RyuJIT
.NET 6.0 : .NET 6.0.4 (6.0.422.16404), X64 RyuJIT
.NET Framework 4.8 : .NET Framework 4.8 (4.8.4510.0), X64 RyuJIT
| Method | Job | Runtime | Mean | Error | StdDev | Ratio | RatioSD |
|--------------- |------------------- |------------------- |-------------:|-----------:|-----------:|------:|--------:|
| Replace | .NET 6.0 | .NET 6.0 | 1,350.99 ns | 7.502 ns | 7.017 ns | 0.33 | 0.01 |
| Replace | .NET Framework 4.8 | .NET Framework 4.8 | 4,150.69 ns | 80.004 ns | 82.158 ns | 1.00 | 0.00 |
| | | | | | | | |
| IndexOf | .NET 6.0 | .NET 6.0 | 22,561.81 ns | 435.204 ns | 446.923 ns | 10.44 | 0.34 |
| IndexOf | .NET Framework 4.8 | .NET Framework 4.8 | 2,189.63 ns | 43.739 ns | 88.354 ns | 1.00 | 0.00 |
| | | | | | | | |
| IndexOfOrdinal | .NET 6.0 | .NET 6.0 | 261.22 ns | 2.760 ns | 2.446 ns | 0.65 | 0.02 |
| IndexOfOrdinal | .NET Framework 4.8 | .NET Framework 4.8 | 403.50 ns | 7.982 ns | 9.502 ns | 1.00 | 0.00 |
| | | | | | | | |
| Substring | .NET 6.0 | .NET 6.0 | 12.12 ns | 0.310 ns | 0.413 ns | 0.93 | 0.05 |
| Substring | .NET Framework 4.8 | .NET Framework 4.8 | 13.07 ns | 0.326 ns | 0.563 ns | 1.00 | 0.00 |
| | | | | | | | |
| Remove | .NET 6.0 | .NET 6.0 | 64.00 ns | 1.208 ns | 1.770 ns | 1.09 | 0.04 |
| Remove | .NET Framework 4.8 | .NET Framework 4.8 | 59.23 ns | 1.020 ns | 1.253 ns | 1.00 | 0.00 |
|
|
|
|
|
|
Zwölf is currently being expanded to version 0.2. Version 0.1 was a simple thing that did not have many obstacles that would not allow a higher clock frequency. Now I'm running the little old processor at 8 MHz (Vcc = Vdd = 5V). That's 160% of the specified maximum clock frequency and 450% of my old Elf. It's still running cool and stable. Not even passive cooling is needed. I guess, the next try will be with 9 MHz.
Version 0.3 is going to be all aboutmy DIY MMU and slightly expanding the RAM. That's why my first mass storage device is included in this version. I'm going to use a Compact Flash memory card as SSD. Let's hope that it can keep up with a 40 years older processor on steroids. In the long run sooner or later some I/O device must come along that can't keep up with the bus timing at that speed, so I probably will have to throw in wait states into the I/O bus cycles anyway. And if not, I can still squeeze a few more kilobytes per second over the bus by using DMA. Coolest thing of all: The processor does not stop processing instructions for DMA. The program keeps running while we load more data over the bus than it could shovel in a program loop.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Do you have any documentation that can help one to re-create your work, and create a clone of the Zwölf to play with?
“Real stupidity beats artificial intelligence every time.”
― Terry Pratchett, Hogfather
|
|
|
|
|
You can have the schematics and my assembly code for version 0.1. You can easily replicate it on a breadboard and I can point you in the right directions to find useful tools like an assembler and an emulator. Zwölf 0.1 is very bare bones, so that the emulator can still be reconfigured to the few changes to the old Elf. That is really helpful to get you started. Unfortunately the emulator will become useless once I get more of the Zwölfy features working, but I'm already in contact with the author who wants to make the emulator more versatile anyway. Still, the processor is very different from the other 8 bit processors of the time and the emulator will probably be a great help to get you more familiar with it.
Later, we will be on our own. Zwöf is a departure from the old Elf concept and therefore most old software and tools will not be very helpful anymore. We are mostly on our own, but that's part of the fun.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Not seen but heard by the potter, Giles. (11)
An easy one to end the week.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
I see what you did there!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I only heard what he did ...
|
|
|
|
|
POLTERGEIST
Anagram of potter Giles
|
|
|
|
|
Spot on. You get Monday's CCC, but Rich gets my
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
2Pac - Changes[^]
Heard this one on the radio a while back.
I listen to the radio about five minutes a week, on my way to the grocery store, so that's a bit of a coincidence.
I used to listen to 2Pac when I was about 13/14 years old.
To be honest, I totally forgot about this one, but after hearing it once I had to hear it again and again and again...
Sadly, he's mostly right and nothing has changed since this was recorded in 1992, or came out in 1998.
Although the USA did get their first black president, so I guess he was at least somewhat wrong about that.
For those who don't know 2Pac, he's considered one of the most influential rappers ever, he was also an actor, he's a best-selling artist with more than 75 million records sold worldwide, he was shot during a drivy-by at 25 in 1996 (this song was released after his death).
If you're thinking this song sounds familiar, but you've never listened to 2Pac before, it's sampled from Bruce Hornsby and the Range's 1986 hit, The Way It Is.
|
|
|
|
|
Around our house it is common when ever something is available in a 2-pack my wife or I will say to the other, 2-pack for sure! and in the cart it goes.
|
|
|
|
|
What if We Paid for Bugs? – George Stocker[^]
It ends with Quote: Take this a bit further, and imagine that in our world that that state of affairs has always existed and exists now. What software would be better in this brave new world? What software would be worse?
Well ... the first thing that springs to mind is that Corel would have been bankrupt for decades.
I can see it as a good idea, myself: I strive for reliable, robust software with as few bugs as possible (none by preference, but ...)
However, a heck of a lot of the source code I see seems to be assembled from a kit of parts (most of which weren't intended to do that job) and hammered together with little or no testing. Would a "pay by the problem" approach improve that? Or just scare the "easy money coder" away from the industry?
What do you think?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|