# CPU Cache

Published articles for CPU Cache.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Rethinking KV Cache Eviction for Agentic LLM Serving

DevFeed: [Rethinking KV Cache Eviction for Agentic LLM Serving](<https://devfeed.tech/articles/rethinking-kv-cache-eviction-for-agentic-llm-serving-113775.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.00391>)

Author: Jiakun Fan, Han Meng, Yuxuan Xia, Hao Mark Chen, Dong Li, Dimitrios S. Nikolopoulos

Published: 2026-11-03T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Distributed Computing](<https://devfeed.tech/sources/arxiv-distributed-computing.md>)

Topics: [LLM optimization](<https://devfeed.tech/topics/llm-optimization.md>), [Cache](<https://devfeed.tech/topics/cache.md>), [LLM Techniques](<https://devfeed.tech/topics/llm-techniques.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [sglang](<https://devfeed.tech/topics/sglang.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [agentic](<https://devfeed.tech/tags/agentic.md>), [attention](<https://devfeed.tech/tags/attention.md>), [cache](<https://devfeed.tech/tags/cache.md>), [capacity](<https://devfeed.tech/tags/capacity.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [cpu-cache](<https://devfeed.tech/tags/cpu-cache.md>), [cs-dc](<https://devfeed.tech/tags/cs-dc.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [history](<https://devfeed.tech/tags/history.md>), [job](<https://devfeed.tech/tags/job.md>), [kv-cache](<https://devfeed.tech/tags/kv-cache.md>), [language-model](<https://devfeed.tech/tags/language-model.md>), [large-language-model](<https://devfeed.tech/tags/large-language-model.md>), [llm](<https://devfeed.tech/tags/llm.md>), [llm-serving](<https://devfeed.tech/tags/llm-serving.md>), [management](<https://devfeed.tech/tags/management.md>), [memory](<https://devfeed.tech/tags/memory.md>), [memory-pressure](<https://devfeed.tech/tags/memory-pressure.md>), [model](<https://devfeed.tech/tags/model.md>), [serving](<https://devfeed.tech/tags/serving.md>)

### AI overview

Penelope targets agent workloads that reuse long histories across turns. It preserves shared prefixes, evicts KV cache from the start of the remaining history while retaining the suffix, and recomputes only missing segments for returning requests. Built into SGLang, it co-designs eviction, recomputation, and GPU-CPU cache management. On real agent traces across three Qwen3 sizes, it reduced mean time to first token and job completion time versus SGLang by up to 60% and 37% with GPU-only caching, and up to 76% and 60% with a two-tier GPU-CPU cache.

### Source excerpt

arXiv:2611.00391v1 Announce Type: new Abstract: Key-value (KV) caches impose substantial memory pressure on large language model serving systems, requiring cache eviction when capacity is insufficient. Existing mechanisms typically evict KV from the ends of cached sequences to preserve prefix sharing across requests. However, agent workloads repeatedly reuse long histories across successive turns. Recomputing the KV cache for tokens near the end of a sequence is substantially more expensive than for earlier tokens because their attention computation involves longer histories. To address this problem, we propose preserving shared prefixes and evicting the KV cache from the beginning of the remaining history while retaining the cached suffix. We build Penelope around this strategy by co-designing the eviction policy, KV recomputation, and unified GPU-CPU cache management. Returning requests reuse the KV cache retained in GPU or CPU memory and recompute only missing segments while preserving reuse of the cached suffix. We implement Penelope in SGLang and evaluate it on three Qwen3 model sizes using real agent traces. Compared with SGLang, Penelope reduces mean time to first token by up to 60% and job completion time by up to 37% with a GPU-only cache, and by up to 76% and 60% with a two-tier GPU-CPU cache.

## New Spectre v2 attack variant leaks Linux root password hash in minutes

DevFeed: [New Spectre v2 attack variant leaks Linux root password hash in minutes](<https://devfeed.tech/articles/new-spectre-v2-attack-variant-leaks-linux-root-password-hash-in-minutes-62174.md>)

Original publisher: [Read original article](<https://www.bleepingcomputer.com/news/security/new-spectre-v2-attack-variant-leaks-linux-root-password-hash-in-minutes/>)

Author: Bill Toulas

Published: 2026-09-29T17:10:11Z

Content type: news

Language: en

Sources: [BleepingComputer](<https://devfeed.tech/sources/bleepingcomputer.md>)

Topics: [Security](<https://devfeed.tech/topics/security.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [side channel](<https://devfeed.tech/topics/side-channel.md>), [sha256](<https://devfeed.tech/topics/sha256.md>)

Tags: [computer-help](<https://devfeed.tech/tags/computer-help.md>), [computer-security](<https://devfeed.tech/tags/computer-security.md>), [computers](<https://devfeed.tech/tags/computers.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [cpu-cache](<https://devfeed.tech/tags/cpu-cache.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [hash](<https://devfeed.tech/tags/hash.md>), [infosec](<https://devfeed.tech/tags/infosec.md>), [infosec-computer-security](<https://devfeed.tech/tags/infosec-computer-security.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [linux](<https://devfeed.tech/tags/linux.md>), [mac](<https://devfeed.tech/tags/mac.md>), [malware](<https://devfeed.tech/tags/malware.md>), [malware-removal](<https://devfeed.tech/tags/malware-removal.md>), [network](<https://devfeed.tech/tags/network.md>), [processor](<https://devfeed.tech/tags/processor.md>), [root-password](<https://devfeed.tech/tags/root-password.md>), [security](<https://devfeed.tech/tags/security.md>), [side-channel-attack](<https://devfeed.tech/tags/side-channel-attack.md>), [spectre](<https://devfeed.tech/tags/spectre.md>), [spyware](<https://devfeed.tech/tags/spyware.md>), [support](<https://devfeed.tech/tags/support.md>), [tech-support](<https://devfeed.tech/tags/tech-support.md>), [technical-support](<https://devfeed.tech/tags/technical-support.md>), [virus](<https://devfeed.tech/tags/virus.md>), [virus-removal](<https://devfeed.tech/tags/virus-removal.md>), [windows](<https://devfeed.tech/tags/windows.md>)

### AI overview

The Branch Target Reuse variant of Spectre v2 uses stale CPU branch-predictor information after JIT code reuses memory. Researchers demonstrated that it can expose Linux root password hashes in a few minutes; fixes have been merged into the Linux kernel, and the reported issues received CVE-2026-64507 and CVE-2026-64508.

### Source excerpt

A new Branch Target Reuse (BTR) attack has been devised that can recover root password hashes on Intel computers running Linux in 3-5 minutes on average. [...]

## Valkey Memory Optimization, Version by Version and Encoding: How Many Bytes Did Each Release Actually Save?

DevFeed: [Valkey Memory Optimization, Version by Version and Encoding: How Many Bytes Did Each Release Actually Save?](<https://devfeed.tech/articles/valkey-memory-optimization-version-by-version-and-encoding-how-many-bytes-did-each-release-actually-save-61918.md>)

Original publisher: [Read original article](<https://www.percona.com/blog/valkey-memory-optimization/>)

Author: Percona Team

Published: 2026-09-29T15:33:33Z

Content type: article

Language: en

Sources: [Percona](<https://devfeed.tech/sources/blog-percona.md>)

Topics: [valkey](<https://devfeed.tech/topics/valkey.md>), [Encoding](<https://devfeed.tech/topics/encoding.md>), [Compression](<https://devfeed.tech/topics/compression.md>), [version](<https://devfeed.tech/topics/version.md>), [CPU Cache](<https://devfeed.tech/topics/cpu-cache.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [caching](<https://devfeed.tech/tags/caching.md>), [cpu-cache](<https://devfeed.tech/tags/cpu-cache.md>), [memory-optimization](<https://devfeed.tech/tags/memory-optimization.md>), [valkey](<https://devfeed.tech/tags/valkey.md>)

### AI overview

A benchmark and source-code analysis compares memory use across Valkey versions 7.2.14 through 9.1.1. In the tested string-heavy workload, average key size fell from 102.48 bytes in 7.2.14 to 64.02 bytes in 9.1.1, a 37.5% reduction. The article attributes major changes to inline key storage and a redesigned hash table, while noting the results do not apply to every Valkey environment.

### Source excerpt

Introduction This RAM/Memory reduction is most useful for Valkey 9.1 environments that are key string heavy. They are used extensively in caching, sessions/authentication, real-time apps, ecomm, Ad tech/martech, and gaming. These scenarios see a reduction of 37.5%, which has been attained in our testing environments versus version 7.2.. The biggest jump in the reduction came ... Continued The post Valkey Memory Optimization, Version by Version and Encoding: How Many Bytes Did Each Release Actually Save? appeared first on Percona.

## 4-bit Rotational Quantization

DevFeed: [4-bit Rotational Quantization](<https://devfeed.tech/articles/4-bit-rotational-quantization-46761.md>)

Original publisher: [Read original article](<https://weaviate.io/blog/4-bit-rotational-quantization>)

Author: John Trengrove

Published: 2026-09-17T00:00:00Z

Content type: article

Language: en

Sources: [Weaviate Blog](<https://devfeed.tech/sources/weaviate-blog.md>)

Topics: [quantization](<https://devfeed.tech/topics/quantization.md>), [Scalability](<https://devfeed.tech/topics/scalability.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [cpu](<https://devfeed.tech/topics/cpu.md>), [CPU Cache](<https://devfeed.tech/topics/cpu-cache.md>), [dataset](<https://devfeed.tech/topics/dataset.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [cpu-cache](<https://devfeed.tech/tags/cpu-cache.md>), [datasets](<https://devfeed.tech/tags/datasets.md>), [encoding](<https://devfeed.tech/tags/encoding.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [engineering-quantization](<https://devfeed.tech/tags/engineering-quantization.md>), [memory](<https://devfeed.tech/tags/memory.md>), [performance](<https://devfeed.tech/tags/performance.md>), [quantization](<https://devfeed.tech/tags/quantization.md>), [scaling](<https://devfeed.tech/tags/scaling.md>), [simd](<https://devfeed.tech/tags/simd.md>), [weaviate](<https://devfeed.tech/tags/weaviate.md>)

### AI overview

This article describes Weaviate 1.39 improvements to 4-bit and 8-bit rotational quantization for vector search. It covers recall, heap reduction, encoding, SIMD acceleration, distance kernels, CPU caching, and how performance changes as datasets scale, including a comparison with TurboQuant.

### Source excerpt

4-bit Rotational Quantization in Weaviate 1.39: the SIMD performance work, a centered tier, scaling analysis and a TurboQuant comparison.

## Python sets and dictionaries can have quadratic-time performance

DevFeed: [Python sets and dictionaries can have quadratic-time performance](<https://devfeed.tech/articles/python-sets-and-dictionaries-can-have-quadratic-time-performance-29426.md>)

Original publisher: [Read original article](<https://lemire.me/blog/2026/09/03/python-sets-and-dictionaries-can-have-quadratic-time-performance/>)

Author: Daniel Lemire

Published: 2026-09-03T14:01:45Z

Content type: article

Language: en

Sources: [Daniel Lemire](<https://devfeed.tech/sources/daniel-lemire.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [hashing](<https://devfeed.tech/topics/hashing.md>), [CPU Cache](<https://devfeed.tech/topics/cpu-cache.md>)

Tags: [array](<https://devfeed.tech/tags/array.md>), [cpu-cache](<https://devfeed.tech/tags/cpu-cache.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [hash](<https://devfeed.tech/tags/hash.md>), [performance](<https://devfeed.tech/tags/performance.md>), [python](<https://devfeed.tech/tags/python.md>)

### AI overview

The article explains why Python sets and dictionaries are not formally constant-time in all cases. Hash collisions can make insertions and membership checks take quadratic time, while growing data structures can also incur reallocation and slower memory access as they exceed CPU cache capacity.

### Source excerpt

In Python, the dict data structure is the conventional key-value structure. E.g., you might store a list of names as keys and have their phone numbers as values. Valentin Ignatev wrote this amusing post on X: It is indeed widely believed that, in the strict sense, the dict data structure and its companion, the set ... Continue reading Python sets and dictionaries can have quadratic-time performance

## 🍔🧠 How Cloudflare Freed 100TB RAM With 5 Cache Changes

DevFeed: [🍔🧠 How Cloudflare Freed 100TB RAM With 5 Cache Changes](<https://devfeed.tech/articles/how-cloudflare-freed-100tb-ram-with-5-cache-changes-18125.md>)

Original publisher: [Read original article](<https://hungrymindsdev.substack.com/p/how-cloudflare-freed-100tb-ram-with>)

Author: Alexandre Zajac

Published: 2026-08-31T15:30:54Z

Content type: article

Language: en

Sources: [Hungry Minds](<https://devfeed.tech/sources/hungry-minds.md>)

Topics: [Cloudflare](<https://devfeed.tech/topics/cloudflare.md>), [Cache](<https://devfeed.tech/topics/cache.md>), [CPU Cache](<https://devfeed.tech/topics/cpu-cache.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>)

Tags: [cache](<https://devfeed.tech/tags/cache.md>), [cloudflare](<https://devfeed.tech/tags/cloudflare.md>), [cpu-cache](<https://devfeed.tech/tags/cpu-cache.md>), [software](<https://devfeed.tech/tags/software.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>)

### AI overview

Cloudflare optimized the storage of DNS cache entries in its Big Pineapple platform through five changes, reducing per-entry memory usage by more than 50% and freeing roughly 100 terabytes across its fleet. The reported changes also increased insert throughput by 43% and reduced lookup latency by 19%.

### Source excerpt

PLUS: Anthropic hardware standard 🤖, Rust state machines 🦀, Agent context compression 💾

## How we doubled vector search throughput on Elasticsearch Serverless

DevFeed: [How we doubled vector search throughput on Elasticsearch Serverless](<https://devfeed.tech/articles/how-we-doubled-vector-search-throughput-on-elasticsearch-serverless-78905.md>)

Original publisher: [Read original article](<https://www.elastic.co/search-labs/blog/vector-search-serverless-simdvec-throughput>)

Author: Chris Hegarty,Lorenzo Dematte

Published: 2026-05-28T00:00:00Z

Content type: article

Language: en

Sources: [Elasticsearch Labs](<https://devfeed.tech/sources/elasticsearch-labs.md>)

Topics: [elasticsearch](<https://devfeed.tech/topics/elasticsearch.md>), [Elastic Cloud](<https://devfeed.tech/topics/elastic-cloud.md>), [Embeddings](<https://devfeed.tech/topics/embeddings.md>), [hybrid-search](<https://devfeed.tech/topics/hybrid-search.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [cpu-cache](<https://devfeed.tech/tags/cpu-cache.md>), [elasticsearch](<https://devfeed.tech/tags/elasticsearch.md>), [inside-elastic](<https://devfeed.tech/tags/inside-elastic.md>), [search](<https://devfeed.tech/tags/search.md>), [serverless](<https://devfeed.tech/tags/serverless.md>), [simd](<https://devfeed.tech/tags/simd.md>), [vector-database](<https://devfeed.tech/tags/vector-database.md>), [vector-search](<https://devfeed.tech/tags/vector-search.md>)

### AI overview

Elasticsearch Serverless now uses the simdvec native SIMD scoring engine directly with memory-mapped blob-cache regions, avoiding heap copies for vector scoring. In benchmarks on a warm cache with an 18-million-vector MSMARCO dataset, concurrent throughput rose from 398 to 739 operations per second, while p99.9 latency fell from 237 ms to 30 ms with identical recall. The article also outlines planned cache and memory-management optimizations for further vector-search improvements.

### Source excerpt

How we brought Elasticsearch's native SIMD scoring engine to serverless, and why serverless is where vector search innovation happens next.

## Bloom Filters vs Counting Bloom Filters: When Deletions Kill Performance

DevFeed: [Bloom Filters vs Counting Bloom Filters: When Deletions Kill Performance](<https://devfeed.tech/articles/bloom-filters-vs-counting-bloom-filters-when-deletions-kill-performance-39567.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/15-bloom-filters-deletable-bloom-filters/>)

Author: hello@ankit-rana.com

Published: 2026-03-17T00:00:00Z

Content type: article

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [Cache](<https://devfeed.tech/topics/cache.md>), [CPU Cache](<https://devfeed.tech/topics/cpu-cache.md>)

Tags: [bloom-filter](<https://devfeed.tech/tags/bloom-filter.md>), [cache](<https://devfeed.tech/tags/cache.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [cpu-cache](<https://devfeed.tech/tags/cpu-cache.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [distributed-systems](<https://devfeed.tech/tags/distributed-systems.md>), [false-negative](<https://devfeed.tech/tags/false-negative.md>), [false-positives](<https://devfeed.tech/tags/false-positives.md>), [memory](<https://devfeed.tech/tags/memory.md>), [performance](<https://devfeed.tech/tags/performance.md>), [probabilistic](<https://devfeed.tech/tags/probabilistic.md>), [systems](<https://devfeed.tech/tags/systems.md>)

### AI overview

The article explains that standard Bloom filters support membership checks but not deletion because clearing shared bits can create false negatives. Counting Bloom filters enable deletion with counters, but their larger memory footprint can push lookups out of CPU cache and increase latency through random memory access.

### Source excerpt

A standard Bloom filter is append-only because bits are shared between items, so clearing a bit for one item can create a false negative for another. Counting Bloom filters fix deletion by replacing each bit with a 4-bit or 8-bit counter, which multiplies the footprint four to eight times, pushes the structure out of L3, and turns each of the k lookups into a roughly 100 ns RAM hit instead of a 10 ns cache hit.

## Cuckoo Filters: Cache-Friendly Membership Checks With Deletions

DevFeed: [Cuckoo Filters: Cache-Friendly Membership Checks With Deletions](<https://devfeed.tech/articles/cuckoo-filters-cache-friendly-membership-checks-with-deletions-39568.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/16-cuckoo-filters-architecture/>)

Author: hello@ankit-rana.com

Published: 2026-03-17T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [CPU Cache](<https://devfeed.tech/topics/cpu-cache.md>), [Cache](<https://devfeed.tech/topics/cache.md>), [hashing](<https://devfeed.tech/topics/hashing.md>)

Tags: [cache](<https://devfeed.tech/tags/cache.md>), [capacity](<https://devfeed.tech/tags/capacity.md>), [cpu-cache](<https://devfeed.tech/tags/cpu-cache.md>), [cuckoo-filter](<https://devfeed.tech/tags/cuckoo-filter.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [false-positive](<https://devfeed.tech/tags/false-positive.md>), [hash](<https://devfeed.tech/tags/hash.md>), [insert](<https://devfeed.tech/tags/insert.md>), [performance](<https://devfeed.tech/tags/performance.md>), [probabilistic](<https://devfeed.tech/tags/probabilistic.md>), [spatial-locality](<https://devfeed.tech/tags/spatial-locality.md>), [systems](<https://devfeed.tech/tags/systems.md>)

### AI overview

This article explains how Cuckoo filters support deletions while improving CPU cache behavior compared with counting Bloom filters. They check two specific buckets using compact fingerprints, but insertions can fail when kick-out chains exceed their limit, requiring capacity planning or overflow handling.

### Source excerpt

A Cuckoo filter stores a one-to-two byte fingerprint in a hash table and finds it by checking exactly two buckets, the primary index and its XOR-derived alternate, instead of k random bit positions scattered across a large array. That spatial locality is the whole win on real CPUs. The trade-off is a hard edge: when the kick-out chain exceeds its limit, the insert fails outright.

## The code that wasn't there: Reading memory on an Android device by accident

DevFeed: [The code that wasn't there: Reading memory on an Android device by accident](<https://devfeed.tech/articles/the-code-that-wasn-t-there-reading-memory-on-an-android-device-by-accident-68085.md>)

Original publisher: [Read original article](<https://github.blog/security/vulnerability-research/the-code-that-wasnt-there-reading-memory-on-an-android-device-by-accident/>)

Author: Man Yue Mo

Published: 2023-02-23T17:00:00Z

Content type: article

Language: en

Sources: [GitHub Blog](<https://devfeed.tech/sources/github-engineering.md>)

Topics: [Android Security](<https://devfeed.tech/topics/android-security.md>), [Cryptography](<https://devfeed.tech/topics/cryptography.md>), [Nitro Isolation Engine](<https://devfeed.tech/topics/nitro-isolation-engine.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [cpu-cache](<https://devfeed.tech/tags/cpu-cache.md>), [cve](<https://devfeed.tech/tags/cve.md>), [github-security-lab](<https://devfeed.tech/tags/github-security-lab.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [memory](<https://devfeed.tech/tags/memory.md>), [qualcomm](<https://devfeed.tech/tags/qualcomm.md>), [security](<https://devfeed.tech/tags/security.md>), [vulnerability-research](<https://devfeed.tech/tags/vulnerability-research.md>)

### AI overview

The article examines CVE-2022-25664, a Qualcomm Adreno GPU vulnerability that allows a malicious Android app to leak stale user-space and kernel memory. It explains how an unsynchronized CPU cache and physical memory view enables the leak, how kernel memory disclosures can produce a KASLR bypass, and that the issue was publicly disclosed and patched in 2022.

### Source excerpt

CVE-2022-25664, a vulnerability in the Qualcomm Adreno GPU, can be used to leak large amounts of information to a malicious Android application. Learn more about how the vulnerability can be used to leak information in both the user space and kernel space level of pages, and how the GitHub Security Lab used the kernel space information leak to construct a KASLR bypass.

## Java 8 Parallel Operations Are Not As Simple As They Seem

DevFeed: [Java 8 Parallel Operations Are Not As Simple As They Seem](<https://devfeed.tech/articles/java-8-parallel-operations-are-not-as-simple-as-they-seem-32213.md>)

Original publisher: [Read original article](<https://bruceeckel.com/2016/04/27/java-8-parallel-operations-are-not-as-simple-as-they-seem/>)

Author: Bruce Eckel

Published: 2016-04-27T00:00:00Z

Content type: article

Language: en

Sources: [Bruce Eckel - Computing Thoughts](<https://devfeed.tech/sources/bruce-eckel-computing-thoughts.md>)

Topics: [openjdk](<https://devfeed.tech/topics/openjdk.md>), [High-Performance Computing](<https://devfeed.tech/topics/high-performance-computing.md>), [iteration](<https://devfeed.tech/topics/iteration.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [computational complexity](<https://devfeed.tech/topics/computational-complexity.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [array](<https://devfeed.tech/tags/array.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [cpu-cache](<https://devfeed.tech/tags/cpu-cache.md>), [java](<https://devfeed.tech/tags/java.md>), [java-8](<https://devfeed.tech/tags/java-8.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [streams](<https://devfeed.tech/tags/streams.md>), [timing](<https://devfeed.tech/tags/timing.md>)

### AI overview

Timing examples show that Java 8 parallel operations can help or hurt depending on how data is generated and stored. On the author's machine, parallel `LongStream.rangeClosed()` was faster than its sequential counterpart, while parallelizing `iterate()` was slower and could run out of memory. Primitive `long` arrays allowed fast sequential and parallel sums, but arrays of boxed `Long` values used more memory and made stream reductions and `parallelPrefix()` much slower; the author attributes this largely to cache behavior and object indirection. The timings lack JVM warmup and reflect one machine, so the article treats them as indications rather than general benchmarks. Its practical conclusion is to measure the specific workload and environment instead of assuming `.parallel()` will improve performance.

### Source excerpt

As an exploration of the uncertainties of streams and parallel streams, let's look at a problem that seems simple: summing an incremental sequence of numbers. There turns out to be a surprising number of ways to do this, and I'll take the risk of comparing them through timing--trying to be careful, but acknowledging that I might fall into one of the many fundamental pitfalls when timing code execution. The results may have some flaws (there's no "warming up" of the JVM, for example), but I think it nonetheless gives some useful indications.

## CPU Cache Flushing Fallacy

DevFeed: [CPU Cache Flushing Fallacy](<https://devfeed.tech/articles/cpu-cache-flushing-fallacy-13631.md>)

Original publisher: [Read original article](<https://mechanical-sympathy.blogspot.com/2013/02/cpu-cache-flushing-fallacy.html>)

Author: Martin Thompson (noreply@blogger.com)

Published: 2013-02-14T12:22:00Z

Content type: article

Language: en

Sources: [Mechanical Sympathy](<https://devfeed.tech/sources/mechanical-sympathy.md>)

Topics: [Cache](<https://devfeed.tech/topics/cache.md>), [cpu](<https://devfeed.tech/topics/cpu.md>), [x86](<https://devfeed.tech/topics/x86.md>), [Latency](<https://devfeed.tech/topics/latency.md>), [systems](<https://devfeed.tech/topics/systems.md>), [intel](<https://devfeed.tech/topics/intel.md>)

Tags: [cache-coherence](<https://devfeed.tech/tags/cache-coherence.md>), [core](<https://devfeed.tech/tags/core.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [cpu-cache](<https://devfeed.tech/tags/cpu-cache.md>), [intel](<https://devfeed.tech/tags/intel.md>), [ipc](<https://devfeed.tech/tags/ipc.md>), [latency](<https://devfeed.tech/tags/latency.md>), [memory-heirarchy](<https://devfeed.tech/tags/memory-heirarchy.md>), [performance](<https://devfeed.tech/tags/performance.md>), [systems](<https://devfeed.tech/tags/systems.md>), [x86](<https://devfeed.tech/tags/x86.md>)

### AI overview

The article explains why describing CPU-cache behavior as a cache "flush" can be misleading. It discusses cache hierarchies, interactions between caches and execution cores, memory latency, cache misses, and cache coherence, using Intel x86 server CPUs as a concrete example.

### Source excerpt

Even from highly experienced technologists I often hear talk about how certain operations cause a CPU cache to "flush". This seems to be illustrating a very common fallacy about how CPU caches work, and how the cache sub-system interacts with the execution cores. In this article I will attempt to explain the function CPU caches fulfil, and how the cores, which execute our programs of instructions, interact with them. For a concrete example I will dive into one of the latest Intel x86 server CPUs. Other CPUs use similar techniques to achieve the same ends. Most modern systems that execute our programs are shared-memory multi-processor systems in design. A shared-memory system has a single memory resource that is accessed by 2 or more independent CPU cores. Latency to main memory is highly variable from 10s to 100s of nanoseconds. Within 100ns it is possible for a 3.0GHz CPU to process up to 1200 instructions. Each Sandy Bridge core is capable of retiring up to 4 instructions-per-cycle (IPC) in parallel. CPUs employ cache sub-systems to hide this latency and allow them to exercise their huge capacity to process instructions. Some of these caches are small, very fast, and local to each core; others are slower, larger, and shared across cores. Together with registers and main-memory, these caches make up our non-persistent memory hierarchy. Next time you are developing an important algorithm, try pondering that a cache-miss is a lost opportunity to have executed ~500 CPU instructions! This is for a single-socket system, on a multi-socket system you can effectively double the lost opportunity as memory requests cross socket interconnects. Memory Hierarchy Figure 1. For the circa 2012 Sandy Bridge E class servers our memory hierarchy can be decomposed as follows: Registers: Within each core are separate register files containing 160 entries for integers and 144 floating point numbers. These registers are accessible within a single cycle and constitute the fastest memory a