profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/mpu/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Quentin Carbonneaux mpu @facebook https://c9x.me/ interested in meaning & behavior

mpu/gthreads 154

Toy Green Threads for C.

mpu/gthreads-art 47

A green threads tutorial.

mpu/fnt 24

Bitmap font edition tools.

mpu/lambda 23

A small λ-calculus interpreter in C

mpu/ninja 4

A lightweight C yacc (and some cool LR(1) code in ml)

mpu/dedukti 3

A type-checker for the λΠ-modulo calculus.

mpu/dkparse 3

A fast λΠ-modulo type checker.

mpu/mlannot 2

See OCaml type annotations in VIM as fast as C.

Pull request review commentfacebook/zstd

[LDM] Speed optimization on repetitive data

 static size_t ZSTD_ldm_generateSequences_internal(             ZSTD_ldm_insertEntry(ldmState, hash, newEntry, *params);              anchor = split + forwardMatchLength;++            /* If there is an overlapping match skip to the end of it.+             * No need to insert every position into our table. This+             * is especially slow because position of a long overlapping match+             * is inserted, every position is inserted.+             */+            if (mLength > (size_t)offset) {

If I understand correctly, we want to save work in the while (ip < ilimit) loop.

If that is the case, I would instead detect the degenerate case using anchor > ip + hashed, then reset ip = anchor - hashed and break instead of continue. It makes it a bit clearer where the savings are expected and also makes it easy to see the relation with the ip reset and the increment line 483.

terrelln

comment created time in 3 months

Pull request review commentfacebook/zstd

[LDM] Speed optimization on repetitive data

 static size_t ZSTD_ldm_generateSequences_internal(             ZSTD_ldm_insertEntry(ldmState, hash, newEntry, *params);              anchor = split + forwardMatchLength;++            /* If there is an overlapping match skip to the end of it.+             * No need to insert every position into our table. This+             * is especially slow because position of a long overlapping match+             * is inserted, every position is inserted.+             */+            if (mLength > (size_t)offset) {+                ip = anchor;

I had a bit of trouble thinking about this because ip used to be constant in this loop.

It probably does not matter much but I think this may skip a bit too much. I would find the code easier to reason about if it skipped just the right amount: ip = anchor - hashed;

terrelln

comment created time in 3 months

PullRequestReviewEvent
PullRequestReviewEvent