(one of the only good benchmarks i've ever seen and worth publishing a paper for)
Discussion
(one of the only good benchmarks i've ever seen and worth publishing a paper for)
but the limitations of automata theory mean that once you initiate the automaton you can't use SIMD unless you go beyond the theory. can we make up an insult for this kind of plodding past the finish line?
not the tortoise and the hare that's so bioessentialist. but literally stop to smell the roses and you might find a shortcut
i had missed this file that actually implemented the regex engine https://github.com/python/cpython/blob/main/Modules/_sre/sre_lib.h that looks much more familiar. the case statement doing what it was made for
this part in particular is fucking............it's really cool actually
/* generate 8-bit version */
#define SRE_CHAR Py_UCS1
#define SIZEOF_SRE_CHAR 1
#define SRE(F) sre_ucs1_##F
#include "sre_lib.h"
/* generate 16-bit unicode version */
#define SRE_CHAR Py_UCS2
#define SIZEOF_SRE_CHAR 2
#define SRE(F) sre_ucs2_##F
#include "sre_lib.h"
/* generate 32-bit unicode version */
#define SRE_CHAR Py_UCS4
#define SIZEOF_SRE_CHAR 4
#define SRE(F) sre_ucs4_##F
#include "sre_lib.h"
what does this mean?
/* This file is included three times, with different character settings */
that's right. they just did compile time polymorphism in 12 lines of standard C
i tried such nonsense trying to make url quoting faster and then i finally realized there was a specific line of code that was very important
so fucking trolly. two lines above they mention string joining a list comprehension is faster than a generator (which makes sense if you think about it) but that part does not fucking matter at all
A space for Bonfire maintainers and contributors to communicate