Re:Blazingly fast linked lists
by vouwfietsman on Tuesday May 14, 2024 @01:14PM
(#40357487)
Indeed, also building a linked list over the stack like that is a crafty but very weird design. Keep it simple.
Re:Blazingly fast linked lists
by dmitry_dygalo on Tuesday May 14, 2024 @01:41PM
(#40357810)
Indeed, I agree with your points.
This idea was added after I wrote the post and wasn't taken from my own optimization efforts in `jsonschema`. Originally, in `jsonschema` the output type is actually a badly composed iterator and I intended to simplify it to just a `Result<(), ValidationError>` for the article, but with this output, there are actually way better optimizations than I originally implemented.
If I'd discovered this idea earlier, I'd probably spend more time investigating it.
- almost no cost in the non-erroring path
- no extra data structures to manage
- a lot less code
I think the post would benefit from a better analysis of why this doesn't work for them.