mwsherman
This will only be effective if the data you’re working on is smaller than 64 bits. If you’re working with bytes, for example, you might get 8x parallelism.
I implemented the sentence boundaries, but also thought that the notion of a “phrase” might be useful for such applications: https://github.com/clipperhouse/uax29/tree/master/phrases
It’s optimized for fast reads in exchange for expensive creation.
One can use unsafe for a zero-copy conversion, but now you are breaking the semantics: a string becomes mutable, because its underlying bytes are mutable.
Or! One can often handle strings and bytes interchangeably with generics: https://github.com/clipperhouse/stringish
A grapheme can be multiple codepoints, with modifiers, joiners, etc.
This is true in all languages, it’s a Unicode thing, not a Go thing. Shameless plug, here is a grapheme tokenizer for Go: https://github.com/clipperhouse/uax29/tree/master/graphemes
ReadOnlySpan<T> in C# is great! In my opinion, Go essentially designed in “span” from the start.
I had forgotten, or perhaps never realized, that substrings in C# allocate. The solution was Spans.
Notably, it caused me to realize that Go had “spans” designed in from the start.
Show HN: Go Allocations Explorer for VS Code
https://marketplace.visualstudio.com/items?itemName=Clipperhouse.go-allocations-vsix
I’ve learned that my intuitions about where an allocation is coming from aren’t always correct. One tracks it down by creating a -memprofile then go tool pprof, and then some searching. It’s all fine, but tedious.So, I’ve put that process into a VS Code sidebar, where one simply clicks a benchmark and gets a list of allocations, with a link to the source line.Hope you’ll try it and give...
Allocations Are a Dependency
I deal with copyright claims [video]
Yagni for Distributed Rate Limiting
The solution is a test that fails when Chrome and Safari have substantially different render times.
Show HN: A more composable rate limiter for Go
https://github.com/clipperhouse/rate
Having seen how complex rate limiting becomes in production, I thought layering should be more expressible.
Casey Handmer on powering data centers [video]
Is a "routing" LLM isomorphic with a single large model?
Designing a Composable Rate Limiter
Self-Hosted x86 Back End Is Now Default in Debug Mode
Poor spill decisions making code 14% slower
(Whether I recommend it, not sure! I did it and then undid it, with suspicion that tests were taking longer due to, perhaps, worse caching of build artifacts.)