This repository (apple/swift-collections) is a pure Swift library providing high-performance, specialized data structures that extend the Swift standard library. It includes stable modules like DequeModule (ring-buffer deque), OrderedCollections (ordered set/dictionary), HeapModule (min-max heap), BitCollections (BitSet/BitArray), and HashTreeCollections (persistent hash-array mapped trie TreeSet/TreeDictionary). It also contains experimental preview modules (e.g., SortedCollections using B-trees, RopeModule for rope-based BigString, and BasicContainers with non-copyable collections). The code is heavily optimized with copy-on-write, unsafe pointer usage, and advanced Swift ownership features. It is designed for production use with source stability guarantees, while preview modules are explicitly unstable. The library is consumed as a Swift package and integrates seamlessly with standard collection protocols.
Memlab is a comprehensive JavaScript memory leak detection and heap analysis framework developed by Meta. It provides a CLI, a programmatic API, and an MCP (Model Context Protocol) server for AI-assisted debugging. The system captures heap snapshots from Chromium (via Puppeteer), Node.js, Electron.js, and Hermes, then parses and analyzes them to identify memory leaks, optimization opportunities, and retention patterns. It includes specialized detectors for detached DOM elements, React component leaks, event listener accumulation, duplicate strings, and global variable bloat. The architecture is a monorepo with packages for core parsing and algorithms, E2E browser automation, heap analysis plugins, a public API, a CLI, an in-browser visualizer (MemLens), and an MCP server that exposes over 100 analysis tools. Key data flows involve warmup, browser interaction, snapshot capture, parsing, leak filtering, trace clustering (heuristic and ML-based), and report generation. External dependencies include Puppeteer, Chromium, and the MCP SDK.
This repository is an educational library providing implementations of fundamental data structures and algorithms in JavaScript and TypeScript. It covers arrays, stacks, queues, linked lists, sets, dictionaries/hash tables, trees (BST, AVL, Red-Black, Fenwick, Segment), heaps, tries, and graphs, along with associated algorithms (sorting, searching, graph traversals, shortest paths, minimum spanning trees). The code is well-structured, generic, and thoroughly tested with Jest. Each data structure and algorithm is presented as an independent module, making it easy to study or reuse. The TypeScript versions include type annotations and complexity documentation. While primarily a learning resource, the implementations are production-quality and can be extracted for use in other projects.