154 Followers
111 Following
9.1K Posts
Nerd with interest in programming and trouble in social settings. Autistic, with lots of half-finished projects that are sometimes hard to keep up with. I only speak English but know a few programming languages - my favourites are Lua and Rust (just learning), I'm ok with TypeScript and C++, and I will put up with Python but reluctantly.

UK-based

Fascists, bigots etc never welcome
I'll try to only boost and post things with Alt text

Avatar by
@[email protected] <3

Reviews:
“as much as i like talking to you, i think you should be held far away from a puter” -
@[email protected]
Pronounsshe/her
@sugar @lunareclipse consider me atonished!
@lunareclipse what on earth, I can't understand how anyone would think a court appropriate. maybe it's just because my mind equates courts with "trial" and "criminal"!
@lunareclipse what does court fees mean? surely you don't have to go to court to transition? I presume you mean gender... ​
@mitsunee @hazelnoot I'm a bit confused by your wording, sorry ​

I see what you mean, just not how it really applies to my replies? I wasn't addressing anything to
you, just gathering some data I thought hazel would find helpful.
@mitsunee @hazelnoot sorry, what do you mean? The best function doesn't step through one char at a time, the loop is unrolled…?
@hazelnoot @mitsunee oops, I made the regex incorrectly for both tests! It should have been /^svg$/i, using the start- and end-of-string anchors. Fixing this has a negligible effect on all of the results, surprisingly enough.
@hazelnoot @mitsunee whatever you choose, I do recommend adding a comment explaining why you wrote it that way, as otherwise some well-meaning soul will simply change it later ​

@hazelnoot @mitsunee I found a faster and more compact version!

function d(name, attribs) { // the "svg" tag is, of course, SVG if (name.length === 3 && (name.charAt(0) === 's' || name.charAt(0) === 'S') && (name.charAt(1) === 'v' || name.charAt(1) === 'V') && (name.charAt(2) === 'g' || name.charAt(2) === 'G')) { resolve(true); } }
Firefox results
Profiling functions over 1000 iterations. a: 2 b: 5 c: 3 d: 4(The numbers for 1000 vary so wildly between 1 and 3, and sometimes 4-5, that they're not worth considering)
Profiling functions over 10000 iterations. a: 155 b: 249 c: 245 d: 126Profiling functions over 100000 iterations. a: 12921 b: 27898 c: 27576 d: 12584
Chromium results
Profiling functions over 1000 iterations. a: 1.799999998882413 b: 2.599999999627471 c: 2.699999999254942 d: 1.5(The numbers for 1000 vary quite a bit, though not as much as in Firefox)
Profiling functions over 10000 iterations. a: 121.40000000037253 b: 194.90000000037253 c: 196.59999999962747 d: 98Profiling functions over 100000 iterations. a: 10114 b: 19862.099999999627 c: 20497.300000000745 d: 9974.400000000373

@hazelnoot @mitsunee while running the last test my laptop makes a very peculiar sound indeed - a tiny high-pitched whining 🤔