惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
F
Fortinet All Blogs
爱范儿
爱范儿
博客园 - Franky
MyScale Blog
MyScale Blog
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
B
Blog
P
Proofpoint News Feed
IT之家
IT之家
宝玉的分享
宝玉的分享
D
DataBreaches.Net
S
SegmentFault 最新的问题
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
M
MIT News - Artificial intelligence
L
LangChain Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
雷峰网
雷峰网
Stack Overflow Blog
Stack Overflow Blog
量子位
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

Stonecharioteer on Tech

I Traced My Traffic Through a Home Tailscale Exit Node What Was I Reading Last? In Three Not-So-Easy Pieces Dogfooding Is Hard Code blocks in your books, finally GoForGo v0.9.0 Merrilin - We built an app to read books I use a Macbook now Data Structures & Algorithms - Preparing for Interviews Using a local DNS namespace for local service discovery Direction KOllector - Publishing KOReader Highlights gbt: branches touched in the last 24 hours A Soiree into Symbols in Ruby Some Smalltalk about Ruby Loops Ruby Blocks Returning from Ruby Blocks, Procs and Lambdas My Linux Laptop Finally Works: How Claude Helped Me Fix Years of Annoyances TIL: Watchexec - Modern File Watching for Development Workflows A Less Busy Mind GoForGo - Learn Go through live examples Migrating My Old Blog to Hugo with Claude The Qtile Window Manager: A Python-Powered Tiling Experience Read the RFCs that Built the Internet Py-x-Protobuf - Or How I Learned to Stop Worrying and Love Protocol Buffers Python Reverse a List New Beginnings Leaving ChainSafe Systems Screen Lock for Cinnamon Desktop using Zenity and Terminal Commands Crews Not Teams A System for Getting Better at LeetCode
TIL: The Little Book of Rust Macros and Rust Performance ...
2021-04-25 · via Stonecharioteer on Tech

Introduction - The Little Book of Rust Macros

Comprehensive guide to understanding and writing Rust macros:

What It Covers:

  • Macro Fundamentals: How macros work in Rust’s compilation process
  • Declarative Macros: macro_rules! patterns and syntax
  • Procedural Macros: Custom derive, attribute, and function-like macros
  • Advanced Patterns: Complex macro techniques and best practices
  • Debugging: Tools and techniques for debugging macro code

Why Macros Matter in Rust:

  • Code Generation: Eliminate boilerplate and repetitive code
  • Domain-Specific Languages: Create custom syntax for specific use cases
  • Compile-Time Logic: Perform complex operations at compile time
  • Zero-Cost Abstractions: Generate efficient code without runtime overhead

Learning Path:

  1. Start with simple macro_rules! examples
  2. Understand pattern matching in macros
  3. Progress to procedural macros
  4. Learn debugging and testing techniques

The Rust Performance Book

Title Page - The Rust Performance Book

Authoritative guide to optimizing Rust code performance by Nicholas Nethercote:

Key Topics:

  • Profiling: Tools and techniques for measuring performance
  • Memory Management: Optimizing allocations and memory usage
  • CPU Optimization: Instruction-level optimizations
  • Compilation: Compiler flags and optimization settings
  • Benchmarking: Proper performance measurement techniques

Performance Areas:

  • Hot Path Optimization: Focus optimization efforts effectively
  • Data Structure Choice: Selecting optimal data structures
  • Algorithm Efficiency: Complexity analysis and optimization
  • System-Level Concerns: Cache efficiency, branch prediction

Why This Book Is Valuable:

  • Written by a Mozilla performance engineer
  • Real-world examples and case studies
  • Rust-specific optimization techniques
  • Practical, actionable advice

Both resources are essential for Rust developers looking to write more sophisticated and efficient code.