Latest Tech News

Stay updated with the latest in technology, AI, cybersecurity, and more

Filtered by: size_t Clear Filter

Diff Algorithms

For software engineers, diffs are a ubiquitous method for representing changes: We use diffs to compare different versions of the same file (e.g., during code review or when trying to understand the history of a file), to visualize the difference of a failing test compared with its expectation, or to apply changes to source files automatically. Every project I worked on professionally or privately eventually needed a diff to visualize a change or to apply a patch. However, I have never been sat

Adjacency Matrix and std:mdspan, C++23

In graph theory, an adjacency matrix is a square matrix used to represent a finite (and usually dense) graph. The elements of the matrix indicate whether pairs of vertices are adjacent or not, and in weighted graphs, they store the edge weights. In many beginner-level tutorials, adjacency matrices are implemented using vector of vectors (nested dynamic arrays), but this approach has inefficiencies due to multiple memory allocations. C++23 introduces std::mdspan , which provides a more efficient

Going faster than memcpy

Going faster than memcpy While profiling Shadesmar a couple of weeks ago, I noticed that for large binary unserialized messages (>512kB) most of the execution time is spent doing copying the message (using memcpy ) between process memory to shared memory and back. I had a few hours to kill last weekend, and I tried to implement a faster way to do memory copies. Autopsy of memcpy Here’s the dumb of perf when running pub-sub for messages of sizes between 512kB and 2MB. Children Self Shared Ob