AttilaT

Joined 1 year ago

Karma
67
Submissions
10
Member since
Mar 23
github.com/attilatorda
View on Hacker News

Recent submissions

Comment · 24 days ago
A new way to benchmark LLMs. Feel free not to trust me and go through the source code, I'm not stealing any API keys.
Comment · 1 year ago
I made a small tool that deletes temporary files, it can be used to clean up Downloads or other temp files. Any comments or feature ideas are welcome!
Comment · 1 year ago
A minimalist .bat script that adds these right-click context menus to Windows Explorer:

-Add to System PATH -Instant CMD/PowerShell

Further ideas? eg. Should I add PATH removal?

Comment · 1 year ago
I recently developed a new data structure called the Shift-To-Middle Array, designed as an alternative to std::deque, std::vector, and linked lists. My goal was to optimize insertion and deletion at both ends, while also improving cache locality and performance compared to traditional implementations.

What is the Shift-To-Middle Array? Unlike std::deque, which uses a fragmented block-based structure, the Shift-To-Middle Array maintains a contiguous memory layout. Instead of shifting elements inefficiently (like std::vector), it dynamically redistributes free space toward the middle, reducing unnecessary data movement.

Key Features: Fast insertions & deletions at both ends (amortized O(1)) Efficient cache utilization (better than linked lists) Supports fast random access (O(1)) No pointer chasing (unlike linked lists) Parallelization & SIMD optimizations possible

Performance Benchmarks I benchmarked Shift-To-Middle Array vs. std::deque vs. ExpandingRingBuffer vs. std::queue across different workloads. Some highlights:

Push-heavy workload → Shift-To-Middle Array showed improved insertion performance over std::deque.

Pop-heavy workload → Showed improvements in memory access and removal operations.

Random insert/remove workloads → Demonstrated better cache efficiency compared to linked lists.

(Full benchmarks and source code available below.)

When Should You Use It? High-performance queue-like structures

Game engines (handling real-time events efficiently)

Networking applications (handling packet buffers)

Dynamic sequences (e.g., computational geometry, physics sims)

Would love to hear thoughts and feedback from the community! Have you encountered similar performance bottlenecks with std::deque or other dynamic structures?

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton