Readit News logoReadit News
chrchang523 commented on Removing newlines in FASTA file increases ZSTD compression ratio by 10x   log.bede.im/2025/09/12/zs... · Posted by u/bede
bede · 6 months ago
Yes, when doing anything intensive with lots of sequences it generally makes sense to liberate them from FASTA as early as possible and index them somehow. But as an interchange format FASTA seems quite sticky. I find the pervasiveness of fastq.gz particularly unfortunate with Gzip being as slow as it is.

> Took me a while to realize that Grace Blackwell refers to a person and not an Nvidia chip :)

I even confused myself about this while writing :-)

chrchang523 · 6 months ago
Note that BGZF solves gzip’s speed problem (libdeflate + parallel compression/decompression) without breaking compatibility, and usually the hit to compression ratio is tolerable.
chrchang523 commented on Go’s race detector has a mutex blind spot   doublefree.dev/go-race-mu... · Posted by u/GarethX
klabb3 · 7 months ago
Function body, so no don’t put it in your loop. Just break it out to a helper fn if needed. This isn’t a big problem in practice.
chrchang523 · 7 months ago
Yes, though I think tooling could be better; if I had more spare time I'd write a linter which flagged defers in loops that didn't come with an accompanying comment.
chrchang523 commented on Show HN: Go Plan9 Memo   pehringer.info/go_plan9_m... · Posted by u/pehringer
lexh · a year ago
A bit over my head, but I enjoyed the way the writing brings us along for the ride.

This can’t be the first pass someone has made at something like this, right? There must be literal dozens of SIMD thirsty Gophers around. Would a more common pattern be to use CGO?

chrchang523 · a year ago
The problem with cgo is the high function-call overhead; you only want to use it for fairly big chunks of work. Calling an assembly function from Go is a lot cheaper.

https://pkg.go.dev/github.com/grailbio/base/simd has some work I’ve done in this vein.

chrchang523 commented on Evaluating a class of infinite sums in closed form   johndcook.com/blog/2024/0... · Posted by u/beefman
chrchang523 · 2 years ago
I found it useful to walk through evaluation of a few elementary instances of this class using simpler methods, to put the main result in perspective. Specifically, replace the initial 3 exponent with 0 or 1.

If the exponent is 0, then you have the sum 1/2 + 1/4 + 1/8 + 1/16 + 1/32 + ..., from Zeno's most famous paradox (https://en.wikipedia.org/wiki/Zeno%27s_paradoxes ). If you are fortunate, you previously learned that this converges to 1, and played around with this enough in your head to have a solid understanding of why. If you are less fortunate, I recommend pausing to digest this result.

Then, if the exponent is 1, you have the sum 1/2 + 2/4 + 3/8 + 4/16 + 5/32 + ... .

What happens if we subtract (1/2 + 1/4 + 1/8 + 1/16 + 1/32 + ...) from it? We have (1/4 + 2/8 + 3/16 + 4/32 + ...) left over.

Then, if we subtract (1/4 + 1/8 + 1/16 + 1/32 + ...) from the latter, we still have (1/8 + 2/16 + 3/32 + ...) left over.

Then, if we subtract (1/8 + 1/16 + 1/32 + ...) from the latter, we still have (1/16 + 2/32 + ...) left over.

Continuing in this fashion, we end up subtracting off

(1/2 + 1/4 + 1/8 + 1/16 + 1/32 + ...) + (1/4 + 1/8 + 1/16 + 1/32 + ...) + (1/8 + 1/16 + 1/32 + ...) + (1/16 + 1/32 + ...) + (1/32 + ...) + ...

and this converges to the main sum. And, from the exponent-0 result, we know this is just 1 + 1/2 + 1/4 + 1/8 + 1/16 + ...

chrchang523 commented on Morton: Bit Interleaving in C/C++   github.com/jart/morton... · Posted by u/tosh
muragekibicho · 2 years ago
I saw something similar in Bit Twiddling hacks. Out of utter curiosity, when would you need to interleave bits in prod? Is it something a Saas dev would be doing or maybe sb in embedded programming?
chrchang523 · 2 years ago
Two-bit values are common in bioinformatics, and I’ve found the ability to efficiently convert between packed arrays of 1- and 2-bit values to be valuable in that domain.
chrchang523 commented on The simple beauty of XOR floating point compression   clemenswinter.com/2024/04... · Posted by u/cwinter
chrchang523 · 2 years ago
One question: it is possible for the XOR of two consecutive floating-point numbers to have 32-63 leading zeros; the numbers 32-63 do not fit in 5 bits. I imagine this is treated by Gorilla like 31 leading zeros?
chrchang523 commented on Math Team   benexdict.io/p/math-team... · Posted by u/carabiner
jhshah · 2 years ago
Completely agree, I also liked the problem and thought it was conceptual as far as these things go.

Asking for N mod 1000 was another cute twist that was meant to get you thinking about the divisibility properties of the totient function - "hmm, so (p-1) always divides \phi(n) for all prime factors p of n, how convenient..."

chrchang523 · 2 years ago
The mod 1000 is actually a consequence of the test format: all answers are integers in [0, 999], you fill in 3 digit-bubbles.
chrchang523 commented on Superlinear Returns   paulgraham.com/superlinea... · Posted by u/jger15
ad93611 · 2 years ago
Could you please elaborate on the quadratic curves in real life?
chrchang523 · 2 years ago
Suppose the value of a network to an individual user is proportional to the number of users. Then the total value of the network, summed across all its users, is proportional to the square of the number of users.

See also https://en.wikipedia.org/wiki/Network_effect .

chrchang523 commented on Superlinear Returns   paulgraham.com/superlinea... · Posted by u/jger15
quantified · 2 years ago
Exponential growth tends to work at the beginning of "something". Since the world is finite, at some point new somethings need to be created or discovered for an exponential growth, quite possibly eating the last thing that was exponentially growing at one point. So part of the trick is to be in on the exponential growth phase and sell off / reduce exposure to the thing when that tapers off.
chrchang523 · 2 years ago
Yup, and that's why I'd consider this a "101" essay. The larger exponential-growth trends (e.g. Moore's Law) practically always have a microstructure with many sigmoid curves. After you've encountered your first exponential, the "201" lesson about saturation becomes important.

u/chrchang523

KarmaCake day586March 8, 2017View Original