Hooray, my IPv6 parser is mostly working, and only missing the final cursed case.

It's done. By god, it's done.

I mean, parseIPv6 is also awful and embarassing and much worse than the stdlib implementation right now. But is it at least faster than the stdlib?
Ope never mind, other tests are failing still. Bah.
lol, fuck. Not only is it 50% slower than the stdlib's parser, it's also not alloc-free.
oh, it's because it's benchmarking parsing a zone, and we have to intern the zone... I think.
Yess. For IPs without a zone, my parser is faster and alloc-free. Not hugely faster mind you.
I guess if you squint, it's about as good as the IPv4 parser. It has to touch 4x more bytes, so just under 4x slower isn't that bad.
That said, I'm pretty sure my code is a branch predictor's nightmare right now, not to mention it's entirely unreadable even by my low standards. Needs another round of improving, now that it passes tests.
I think it's time to checkpoint and play Elite Dangerous tonight, but the plan for tomorrow is to see if I can't turn this into a more explicit state machine, so that the code is considering fewer possibilities at any one time.
In general, I think all IPv6s parse in 4 stages:
- Hex before ellipsis
- Hex after ellipsis
- Embedded IPv4
- Zone suffix

All but the first are optional, and the conditionals to decide which new state to transition to is a bit ugly...
... But I think within each state the "happy loop" condition is simple and should keep the CPU and branch predictors pretty happy.
Current WIP, as I pack in for tonight to go play Elite: https://t.co/acwEFavxQi

WARNING: side-effects may include eye bleeding and stomach ulcers.
It also still has a bunch of debugging code in it, the comments may not match the code any more, and I haven't yet iterated on the benchmarks and SSA to see what hand-inlining was actually productive vs. harmful. So it's all hand-inlined, in the worst possible way.
The code's definitely not getting submitted like this, but that's my hacking process I guess :)

More from Internet

The new tactics to implement the #CancelCulture are quite ingenious. They are not going after what they want cancelled directly, they are going after how it gets to you! It’s attacking the free market, and it’s harder to spot and harder to fight before it’s done! Read on!

1/


Here’s an example. If there’s a challenge to the normal Social Media platforms, then they aren’t wasting time going after the new app, they are making the app unavailable well more difficult to get. This puts people off from going to the trouble or switching.

2/


They are going to do this in a way you won’t see it coming. They are going to stop it before the source.

Soon, the media is going to be a complete left wing echo-chamber. Social Media, TV and Papers all left wing and you don’t get to say “what about free speech?”

3/


Why? Because they aren’t playing against free speech. They are going after the free market. This also gives you an idea what socialism can and will do.

I don’t expect my account to last long now I’m watching this and exposing it! Please share, stand your ground and don’t quit!


Here’s the proof that CNN are trying to get Fox cancelled at the broadcast level, stop it getting into people’s homes by getting the TV providers to ban it. Again, targeted before what we see as the source. This is also the groundwork for any
The Internet and mobile phones have taken over our lives. But it comes with increasing security concerns. Website data breaches, phishing attacks, and other online scams are commonplace. Here's a thread for regular people on how to increase your security online.
#StaySafeOnline

#1
Go to your Google account settings. Revoke permissions from all the apps you don't use:
https://t.co/cMGgSgtRTI

Also check if any app has access to your contacts or - gasp! - your entire email. Strongly reconsider both, especially access to your email.

Giving access to your contacts lets companies spam those people.

Giving access to your email - email organising apps, for instance - renders your online security meaningless. Password resets are often done with email, and if an external entity can access that, game over!

#2
Go to your Twitter account settings and revoke permissions from all the apps you don't use or trust:
https://t.co/lXxCgdnaXH

Online quizzes and such sites often ask for permission to post tweets for you, read your tweets, and even your DMs!.

People click "OK" without reading the fine print.

But imagine the security and privacy risk with having some unknown entity be able to post tweets and read your private DMs just to post the results of what Game of Thrones character you are.

You May Also Like