 
      
    | You are here | aarol.dev | ||
| | | | | www.bazhenov.me | |
| | | | | Introduction Link to heading Suppose we need to write a function that computes the next set of numbers in a range and stores them in a slice, as shown below: let pl = RangePl::new(1..12); let mut buffer = [0u64; 4]; pl.next_batch(0, &mut buffer); // returns 4, buffer[..] = [1, 2, 3, 4] pl.next_batch(0, &mut buffer); // returns 4, buffer[..] = [5, 6, 7, 8] pl.next_batch(10, &mut buffer); // returns 2, buffer[0..2] = [10, 11] pl.next_batch(10, &mut buffer); // returns 0, buffer not updated Key factors: | |
| | | | | coredumped.dev | |
| | | | | In this post, we are going to take a deep dive into pointer tagging, where metadata is encoded into a word-sized pointer. Doing so allows us to keep a compact representation that can be passed around in machine registers. This is very common in implementing dynamic programming languages, but can really be used anywhere that additional runtime information is needed about a pointer. We will look at a handful of different ways these pointers can be encoded and see how the compiler can optimize them for diff... | |
| | | | | purplesyringa.moe | |
| | | | | I have recently done some performance work and realized that reading about my experience could be entertaining. Teaching to think is just as important as teaching to code, but this is seldom done; I think something I've done last month is a great opportunity to draw the curtain a bit. serde is the Rust framework for serialization and deserialization. Everyone uses it, and it's the default among the ecosystem. serde_json is the official serde "mixin" for JSON, so when people need to parse stuff, that's wh... | |
| | | | | tinkering.xyz | |
| | | As part of my PhD I do computational modeling of quantum-biological systems. One of my simulations was misbehaving and in certain cases could take 8 hours to complete. That's really bad when you're trying to iterate quickly. This post describes how I made a series of optimizations to reduce the runtime by 250x via profiler driven algorithmic improvements, rewriting the core in Rust, and making use of parallelism. | ||