[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1496":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":15,"starSnapshotCount":15,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},1496,"dlht","jeremiah-masters\u002Fdlht","jeremiah-masters","High-performance, lock-free concurrent hash table in Go, based on DLHT, with cooperative resizing and cache-efficient buckets.","",null,"Go",278,7,4,0,1,5,31,3,50.31,"Apache License 2.0",false,"main",[25,26,27,28,29,30,31,32],"concurrency","data-structures","go","golang","hashtable","lock-free","performance","thread-safe","2026-06-12 04:00:09","# DLHT\n\nDLHT is a high-performance, lock-free hash table for high-concurrency workloads based on DLHT: A Non-blocking Resizable Hashtable with Fast Deletes and Memory-awareness (\u003Chttps:\u002F\u002Farxiv.org\u002Fabs\u002F2406.09986>). It provides lock-free Get, Insert, Delete, and Put operations with sophisticated memory ordering and cooperative resizing.\n\n## Features\n\n- **Lock-free operations**: All operations (Get, Insert, Delete, Put) are lock-free and linearizable\n- **High concurrency**: Scales well with multiple threads and cores\n- **Automatic resizing**: Cooperative resize algorithm that doesn't block operations\n- **Memory efficient**: Cache-line optimized data structures with bounded overflow\n- **Type safe**: Generic implementation supporting any comparable key type and any value type\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com\u002Fjeremiah-masters\u002Fdlht\"\n)\n\nfunc main() {\n    \u002F\u002F Create a new DLHT\n    m := dlht.New[string, int](dlht.Options{InitialSize: 64})\n\n    \u002F\u002F Insert key-value pairs\n    m.Insert(\"apple\", 5)\n    m.Insert(\"banana\", 3)\n\n    \u002F\u002F Get values\n    if value, found := m.Get(\"apple\"); found {\n        fmt.Printf(\"Found: apple = %d\\n\", value)\n    }\n\n    \u002F\u002F Update values atomically\n    if oldValue, updated := m.Put(\"apple\", 10); updated {\n        fmt.Printf(\"Updated apple: %d -> %d\\n\", oldValue, 10)\n    }\n\n    \u002F\u002F Delete keys\n    if oldValue, deleted := m.Delete(\"banana\"); deleted {\n        fmt.Printf(\"Deleted banana (old value: %d)\\n\", oldValue)\n    }\n\n    \u002F\u002F Get statistics\n    stats := m.Stats()\n    fmt.Printf(\"Load factor: %.3f\\n\", stats.LoadFactor)\n}\n```\n\n## API Reference\n\n### Types\n\n- `Map[K Key, V any]`: The main hash table type\n- `Entry[K Key, V any]`: A key-value pair\n- `Options`: Configuration options for creating a new map\n- `Stats`: Statistics about the hash table's current state\n- `Key`: Type constraint for valid key types (uint64 or string)\n\n### Functions\n\n- `New[K Key, V any](opts Options) *Map[K, V]`: Create a new DLHT\n- `(m *Map[K, V]) Get(key K) (V, bool)`: Get a value by key\n- `(m *Map[K, V]) Insert(key K, value V) (V, bool)`: Insert a new key-value pair\n- `(m *Map[K, V]) Put(key K, value V) (V, bool)`: Update an existing key atomically\n- `(m *Map[K, V]) Delete(key K) (V, bool)`: Delete a key and return the old value\n- `(m *Map[K, V]) Stats() Stats`: Get current statistics\n\n## Implementation Details\n\nThis package provides a clean public API that wraps the allocator-based implementation. The project contains two lock-free variants built on the same core design:\n\n- **`allocator\u002F`**: Generic implementation used by `dlht.New`; each slot stores a hash plus a pointer to a heap-allocated entry, supporting arbitrary comparable keys and values.\n- **`inline\u002F`**: Specialized implementation exposed by `dlht.NewInline`; each slot stores the value inline for `uint64` keys and integer values, avoiding per-entry allocation in that path.\n\n## Performance\n\nDLHT is designed for high-performance concurrent workloads:\n\n- **Lock-free**: No blocking between operations\n- **Cache-optimized**: 64-byte buckets fit exactly in cache lines\n- **Bounded overflow**: Maximum 15 slots per bucket for predictable performance\n- **Cooperative resizing**: Non-blocking resize with work-stealing\n\n## Benchmarks\n\nThe charts below compare DLHT against `sync.Map` and other popular concurrent map implementations across four representative workloads as core count scales. Benchmarks were run on an Intel Xeon Platinum 8260 (2.40GHz); raw data is in [benchmarks\u002Fresults\u002Fresults.txt](benchmarks\u002Fresults\u002Fresults.txt).\n\n### Throughput Scaling\n\n![Throughput scaling across workloads](benchmarks\u002Fresults\u002Fthroughput.png)\n\n### Latency Scaling\n\n![Latency scaling across workloads](benchmarks\u002Fresults\u002Flatency.png)\n\nPanels cover read-only reads, insert\u002Fdelete churn, a put-heavy mix, and rapid growth (80% inserts). See [benchmarks\u002Fworkload.go](benchmarks\u002Fworkload.go) for the full workload definitions and [benchmarks\u002Fthroughput_test.go](benchmarks\u002Fthroughput_test.go) for the harness.\n\n## License\n\nLicensed under Apache v2.\n","DLHT 是一个基于 Go 语言的高性能无锁并发哈希表，适用于高并发场景。它提供了无锁且线程安全的 Get、Insert、Delete 和 Put 操作，并支持自动调整大小和高效的缓存使用。核心功能包括：所有操作都是无锁且线性化的，能够很好地扩展到多线程和多核环境；自动调整大小算法不会阻塞其他操作；内存高效的数据结构设计，具有优化的缓存行和有界溢出；类型安全的泛型实现，支持任何可比较的键类型和值类型。该项目适合需要在高并发环境下进行快速数据访问和更新的应用程序，如分布式系统、实时数据分析等。",2,"2026-06-11 02:44:09","CREATED_QUERY"]