Which is faster?
Next: Wordlist. After that: fake Markov.
But first: lunch. Nom nom.
While eating, I'm also going to "quickly" benchmark iocaine4 compiled in the release profile vs the opt profile.
The latter has lto = true and codegen-units = 1.
Well, the opt profile is up to 161k req/sec on jpegs, and... "Hello" is at 163k req/sec, so the difference narrowed a tiny bit.
It does show that fake jpeg generation is extremely fast, though. I'm really, really proud of optimizing the shit out of that.
I mean, look at this, this lets me do this other thing.
It's brilliant, if I dare say so myself.
To generate JPEG chunks, I need the chunks to not contain certain bytes. Instead of generating a full buffer and masking the bad bytes out, I made an RNG that masks them out at generation time, and it sits on top of any other seedable RNG, so you can use whatever RNG algo you want, as long as it is seedable.
I should measure the speed between a ~2k random jpeg, and ~2k text. I wonder if JPEG would overtake the string.
~2k random jpeg: ~161k req/sec
~2k static text: ~159k req/sec
I AM A FUCKING MONSTER.
~2k static text, pre-converted to binary: ~162k req/sec
Marginally faster than random jpeg, and this text is entirely static.
WordList done too, only fake-Markov left. I'll do that later tonight. I need a nap.
After the nap: fake Markov, then a bit of NSoE work to exercise the generators, and then a progress report over the weekend.
Then, from next week, templating, then error rework, then script config, then Lua, and then the real fun begins, and I get to reimplement NSoE.
Somewhere before starting on NSoE, I will rebuild https://iocaine.madhouse-project.org/ too.
New theme, new structure. Something that's navigatable on mobile, and doesn't need so many clicks to get to the interesting parts.
Hm. Maybe I will start rebuilding the site over the weekend. Could publish the progress report there, too, rather than on my own blog.
I mean, I could use a little break from Rust and Roto, and I'm itching to write. Might aswell put that itch to good use!
But now I nap, doggy's already there, and she needs belly scratches.
@algernon small status update on the markov generator: https://codeberg.org/zwol/logorrhea
right now this is basically what was in that PR from months ago, not yet on crates.io and i expect to completely overturn the API at least once but it might still save you some effort
@zwol Lovely! I'll go ahead and use a recent commit in iocaine4 for now (git deps are fine before release) - that saves me a bunch of effort of doing a fake chain1, and pinning to a commit lets you go wild with the API as you wish, and will update when you tell me to (or open a PR).
I was planning to implement a generator that just chooses random words, and applies some sentence-making post-filter. Purely as a placeholder. ↩︎
@zwol One thing I'd love to keep - and make more open - is join_words. So that generating the words, and turning them into sentences / paragraphs would be separate, and would be open to alternative algorithms.
@algernon All sounds good! I have some ideas for `join_words` (and for handling punctuation more cleverly in general), did you have anything specific in mind for how it should work / how it should be exposed on the iocaine side?
Lets do some Markov bullshit.
"Hello" is obviously faster. The interesting question is: by how much?
And the answer is: about 4-5k req/sec, which, at this level, is not a whole lot.