News for hackers. Stuff that matters.
Re:Parsing integers quickly with AVX-512 by Karellen on Monday September 25, 2023 @07:34AM (#37642161)
> I am going to assume that you know the beginning and the end of sequence of digits.

First, that's a strong assumption. But...

> We check whether some value exceeds 9, in which case we had a non-digit character.

Huh? You already know where the end of the digits is. At least, I thought you did? So why would this be necessary?

Re:Parsing integers quickly with AVX-512 by JonChesterfield on Monday September 25, 2023 @12:44PM (#37646749)
You know how many bytes you're going to want to read, and you know they're supposed to be decimal digits, but you also know they might not be.
Re:Parsing integers quickly with AVX-512 by Karellen on Monday September 25, 2023 @03:36PM (#37649390)
I don't understand how that is supposed to resolve the contradiction.
Re:Parsing integers quickly with AVX-512 by joe_guy on Tuesday September 26, 2023 @11:11PM (#37669489)
> We check whether some value exceeds 9,

If I'm seeing the misunderstanding here, the article with that statement is not talking about string length. They're talking about if non numerical input was given, ie, "a" would "exceed 9"

Re:Parsing integers quickly with AVX-512 by Karellen on Thursday September 28, 2023 @11:00AM (#37690529)
Right, but an "a" would be past the end of the digits, and the code assumes you know the end of the digits.

It would make more sense if it was talking about the string length. Then you might find a non-digit before the end. But it specifically says you know where the end of the digits is, not the end of the string.

Edit: Or, I'm trying to figure out what code might exist that found the end of the digits, but not always? The article says "assume you already know this", but computers aren't magic. There's code that figures out where the end of the digits is. So how does that code work, where it finds the end of the digits, but sometimes counts non-digits as digits?