Anonymous
11/7/2025, 9:16:48 PM
No.107135877
>>107135729
>senpai
i barely learned vectorization myself
but its indeed a powerful tool
i wrote an ascii to float that takes 1.5-3 cycles per character read, with better results with bigger strings
ngl im pretty happy with myself, light testing yields that im ~2.5x faster than strtof on a typical string
maybe more bc theres the launch overhead, and the control additions, which souldnt amount to much on 22.6 and 50.9 seconds respectively
heres the code if you wanna have a look
https://files.catbox.moe/1zq8zw.c
you need -mavx2 and -mbmi flags to compile it
and yeah, i cheated a little bit. i take in max 32bytes for integers, 32max for decimals but its not hard or expensive to generalize it into arbitrarily long sequences of numbers
>senpai
i barely learned vectorization myself
but its indeed a powerful tool
i wrote an ascii to float that takes 1.5-3 cycles per character read, with better results with bigger strings
ngl im pretty happy with myself, light testing yields that im ~2.5x faster than strtof on a typical string
maybe more bc theres the launch overhead, and the control additions, which souldnt amount to much on 22.6 and 50.9 seconds respectively
heres the code if you wanna have a look
https://files.catbox.moe/1zq8zw.c
you need -mavx2 and -mbmi flags to compile it
and yeah, i cheated a little bit. i take in max 32bytes for integers, 32max for decimals but its not hard or expensive to generalize it into arbitrarily long sequences of numbers