|
they are trying to justify all that office space they bought, built and/or rented
To err is human to really elephant it up you need a computer
|
|
|
|
|
|
https://www.youtube.com/@xkcd_whatif/videos[^]
Only four videos (3 to 4 1/2 minutes long) but they are worth watching.
I like the online comic format, but I hope he continues with the video format as well - probably a lot of work though.
"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!
|
|
|
|
|
|
|
My Visual FA project was a bust, with broken benchmarks and too slow code.
I know in theory a DFA regex can beat one that backtracks, but Microsoft has done a damned good job of optimizing their engine in recent years.
My issue is they're using ReadOnlySpan<char> over the input string so if I want to beat it I have to use that as well.
That won't stream, but I can generate separate code for that.
Here's my result so far
Microsoft Regex compiled "Lexer": Found 170000 matches in 13ms
FAStringRunner: Found 170000 matches in 10ms
I can probably make it a little faster still.
The FAStringRunner was created by hand, by me, not generated by a regular expression.
It looks like this
q1:
if (((((ch >= 9)
&& (ch <= 10))
|| (ch == 13))
|| (ch == 32)))
{
++len;
if (position < span.Length - 1)
{
ch = span[unchecked((int)++position)];
}
else
{
ch = '\0';
}
goto q1;
}
return FAMatch.Create(2, span.Slice(unchecked((int)p), len).ToString(), p, l, c);
q2:
if (((ch >= 49)
&& (ch <= 57)))
{
++len;
if (position < span.Length - 1)
{
ch = span[unchecked((int)++position)];
}
else
{
ch = '\0';
}
goto q3;
}
goto errorout;
I wrote this by hand because I needed to test to see if I could match faster than Microsoft before I wrote any generator code to do so.
I've got a lot of code to write.
Edit: Okay they're really challenging me here:
Microsoft Regex compiled "Lexer": Found 1440000 matches in 91ms
FAStringRunner: Found 1430000 matches in 81ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 89ms
FAStringRunner: Found 1430000 matches in 80ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 80ms
FAStringRunner: Found 1430000 matches in 80ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 70ms
FAStringRunner: Found 1430000 matches in 80ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 71ms
FAStringRunner: Found 1430000 matches in 80ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 71ms
FAStringRunner: Found 1430000 matches in 81ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 71ms
FAStringRunner: Found 1430000 matches in 80ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 73ms
FAStringRunner: Found 1430000 matches in 79ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 72ms
FAStringRunner: Found 1430000 matches in 80ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 69ms
FAStringRunner: Found 1430000 matches in 79ms
Edit 2: NVM I was in debug mode
Microsoft Regex compiled "Lexer": Found 1440000 matches in 88ms
FAStringRunner: Found 1430000 matches in 24ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 84ms
FAStringRunner: Found 1430000 matches in 22ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 81ms
FAStringRunner: Found 1430000 matches in 22ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 70ms
FAStringRunner: Found 1430000 matches in 21ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 69ms
FAStringRunner: Found 1430000 matches in 22ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 69ms
FAStringRunner: Found 1430000 matches in 21ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 69ms
FAStringRunner: Found 1430000 matches in 22ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 69ms
FAStringRunner: Found 1430000 matches in 22ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 69ms
FAStringRunner: Found 1430000 matches in 22ms
Microsoft Regex compiled "Lexer": Found 1440000 matches in 71ms
FAStringRunner: Found 1430000 matches in 22ms
Better
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
modified 11-Jan-24 9:29am.
|
|
|
|
|
is the difference between 1440000 and 1430000 significant?
Or is that part of the reason for early prototyping? Almost good enough?
“Perfect is the enemy of good enough”
|
|
|
|
|
no. i noticed it after the fact. it's a one off error in my benchmark code, iterated 10,000 times.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Doesn’t this piece of code have one set of brackets too many? Admittedly C type languages are not my forte so I’m probably wrong
if (((ch >= 49)
&& (ch <= 57)))
|
|
|
|
|
The jump tables were copied from code I generated using an AST. It is valid code, even if there are spurious parentheses. They have no effect on the compilation or execution.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Greetings and Kind Regards
It can also be if (c >= 49 && ch <= 57) as relational operators have higher precedence than logical.
|
|
|
|
|
Greetings and Kind Regards
Am I mistaken or is the 1st if logically identical to if (ch == 9 || ch == 10 || ch == 13 || ch == 32) ?
Thank You Kindly
|
|
|
|
|
yes. The if conditions were generated by a tool, and it doesn't bother breaking up the range 9-10 into two single equality comparisons.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Hi All,
I couldn't get at CP yesterday, I'm wondring if it was the damp string that we use instead of Fibre, or the IT guys running like blue bummed fly's around the place,n but now I see has the latest feed in the Lounge as one of the hits from Yesterdays email, Hmmm will this get posted?
Glenn
|
|
|
|
|
See Mathew Dennis's response in thread 'Looks like it's been a rough day at the office...' down below...
|
|
|
|
|
Umm, yes it took me to an old page of the lounge, If I click reply to my message it takes me to my message and When Will Flying Cars die (I can't see your reply to my message??)
|
|
|
|
|
|
I deleted my message, because clicking on the link from my side didn't seem to take me to the message I, and Richard, pointed you towards. Have a great day!
|
|
|
|
|
Not your tin-cans-and-string (that's still working solid). Just one of those things where crapping on other people's work is easier than doing something positive in this world.
Thanks for everyone's understanding and patience yesterday.
cheers
Chris Maunder
|
|
|
|
|
Chris Maunder wrote: understanding and patience I guess you couldn't hear all the cursing.
|
|
|
|
|
Or panic that possibly CodeProject just shut down, for good.
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
I’m begging you for the benefit of everyone, don’t be STUPID.
|
|
|
|
|
What would do?
|
|
|
|
|
MarkTJohnson wrote: Or panic that possibly CodeProject just shut down, for good.
I wouldn't call that "good"...
|
|
|
|
|
Grammer can be dangerous. There's a big difference between
Let's eat, grandma. and
Lets eat grandma
// TODO: Insert something here Top ten reasons why I'm lazy
1.
|
|
|
|
|
So is capitalization.
"Go help your uncle Jack off the horse".
|
|
|
|