When Every Bit Counts: How Valkey Rebuilt Its Hashtable for Modern Hardware

Summary

Disclaimer: This summary has been generated by AI. It is experimental, and feedback is welcomed. Please reach out to info@qconsf.com with any comments or concerns.

The presentation "When Every Bit Counts: How Valkey Rebuilt Its Hashtable for Modern Hardware" by Madelyn Olson delves into the optimization of the Valkey project's hashtable, focusing on modern hardware efficiency improvements.

Key Highlights:

  • Background: Valkey was originally a fork from Redis, and the project aimed to enhance it to maintain high performance and memory efficiency without breaking backward compatibility.
  • Performance Improvements: Key improvements include modifications to memory prefetching, cache-line alignment, and the integration of SIMD operations to boost performance.
  • Memory Efficiency: The project aimed to minimize memory usage by restructuring the data handling to eliminate redundant pointers and consolidate memory access patterns.
  • Enhancements in Hash Table Design: Replacement of linked list resolution with open addressing techniques inspired by Google’s Swiss Table to avoid hash collisions and maintain fast lookups.
  • Challenges and Resolutions:
    • Addressing long tail key issues and performance bottlenecks by embedding data more efficiently and minimizing cache misses.
    • Dealing with memory fragmentation and inefficiencies by considering alternative data structures like self-balancing trees.
  • Outcome: The optimizations led to significant memory savings and performance improvements, achieving about a 40% reduction in memory usage while maintaining or improving throughput.
  • Future Considerations: Further research into refining memory access and enhancing the efficiency of cache utilization is suggested.

This presentation provides insights into the systematic approach taken to modernize Valkey by leveraging advanced techniques tailored for high-performance systems.

This is the end of the AI-generated content.


Abstract

Ever wondered what happens when a bunch of performance-obsessed developers decide their blazing-fast database isn't quite blazing-fast enough? Join me for a deep-dive into how we threw out the beating heart of Valkey, a hashtable that was designed over 15 years ago, and replace it with something faster and more memory efficient. We'll dive into how careful attention to cache-line alignment, memory access patterns, and SIMD operations led to significant improvements in both memory efficiency and performance. Whether you're working on high-performance systems or just curious about modern hardware optimization, you'll come away with concrete insights into how subtle architectural choices can have outsized impacts on real-world performance.


Speaker

Madelyn Olson

Principal Engineer @AWS, Maintainer of the Open-Source Valkey Project

Madelyn is a maintainer of the Valkey project and a Principal Software Development Engineer at Amazon ElastiCache and Amazon MemoryDB, focusing on building secure and highly reliable features for the Valkey engine. In her free time, she enjoys taking in the natural beauty of the pacific northwest with long hikes and serene bike rides.

Read more
Find Madelyn Olson at:

Date

Wednesday Nov 19 / 01:35PM PST ( 50 minutes )

Location

Pacific DEKJ

Topics

Performance Valkey Cache System Design C

Share

From the same track

Session Rust

The Rust High Performance Talk You Did Not Expect

Wednesday Nov 19 / 10:35AM PST

Rust runs faster, but it slows down engineers, right? This was our team’s assumption when we decided to rewrite our code from Kotlin into Rust. But we were wrong in completely unexpected ways.

Speaker image - Ruth Linehan

Ruth Linehan

Software Engineer @Momento, Previously APIs/Webhooks @GitHub and @Puppet

Session

Instrumentation at Scale: Having Your Performance Cake and Eating It Too

Wednesday Nov 19 / 11:45AM PST

In high-performance code, a single misplaced counter increment can cost more than the operation it’s measuring. That creates a paradox: instrument too much and you slow the system down; instrument too little and you miss the insights you need to continuously deliver.

Speaker image - Brian Martin

Brian Martin

Co-founder and Software Engineer @IOP Systems, Focused on High-Performance Software and Systems, Previously @Twitter

Session Python

Python, Numba, and Algorithm Design: Building Efficient Models in Financial Services

Wednesday Nov 19 / 03:55PM PST

The popularity of Python means insurance and financial services companies have a growing body of actuaries, quantitative developers, and software engineers capable of building innovative and customized solutions for both data management and modeling.

Speaker image - Chad Schuster

Chad Schuster

Principal @Milliman Focusing on Risk Management, Modeling, and Technology Consulting Services

Session Performance

Accelerating Performance by Incrementally Integrating Rust Into Existing Codebase

Wednesday Nov 19 / 02:45PM PST

In order to improve the performance of existing applications and services, we can identify the most performance-critical pieces and reimplement them in Rust as opposed to completely rewriting the applications from scratch.

Speaker image - Lily Mara

Lily Mara

Staff Engineer @Discord, Author of "Refactoring to Rust", Previously Engineering Manager @OneSignal