For simplicity, this will just go over the unsigned case
Written for someone, such as myself, who isn't as quick to put together the same logical steps
Given
Find
To motivate what we'll be doing, lets start by considering:
$$ \begin{align*}
| const std = @import("std"); | |
| pub fn main() !void { | |
| var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | |
| defer std.debug.assert(gpa.deinit()); | |
| const allocator = &gpa.allocator; | |
| const num_threads = std.math.max(1, (std.Thread.getCpuCount() catch 1) / 2); | |
| const epolls = try allocator.alloc(std.os.fd_t, num_threads); | |
| defer allocator.free(epolls); |
For simplicity, this will just go over the unsigned case
Written for someone, such as myself, who isn't as quick to put together the same logical steps
Given
Find
To motivate what we'll be doing, lets start by considering:
$$ \begin{align*}
Consider this an informal guide to reading the Solana snapshot format. This guide is written for Solana Labs versions v1.14 through v1.17.
You are probably reading this because you want to read the accounts in a snapshot without going through the pain of interfacing with the Solana Labs codebase.
We assume general familiarity with the Solana ledger.
| // zig build-exe benchmark.zig -OReleaseFast -lc | |
| // ./benchmark 4096 | |
| const std = @import("std"); | |
| const allocator = std.heap.c_allocator; | |
| const iterations_per_byte = 1000; | |
| const warmup_iterations = 10; | |
| comptime { |
Every atomic object has a timeline (TL) of writes:
Each thread has its own view of the world:
Currently, the std.Io interface isn't too optimizable:
io.async/asynConcurrent(f) and io.await which can't be statically aware of when .await will be called, so it must dynamically allocate the context needed to run f.usize with a biased representation for each state.io.cancel, if a blocking operation consumes the stored cancellation request, or if it persists & causes all future blocking ops in that Future to return Cancelled.I've thought of some ideas on how to address these + the all-encompassing nature of th
| const std = @import("std"); | |
| const el: u256 = 0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed; | |
| const L = 1 * el; | |
| fn heea(v: u256) struct { u128, u128 } { | |
| std.debug.assert(len(L) == 253); | |
| std.debug.assert(v < L); | |
| std.debug.assert(v > 0); |