Beyond Arrays: PowerShell Collections for Speed & Scale
summary
Shows concrete swaps and measured wins: choose Generic Lists over arrays for resizable typed collections, use HashSet to deduplicate 10,000 items in ~1 ms versus Select-Object -Unique ~500 ms, and replace Where-object scans with hash-based lookups so CSV comparisons drop from ~19,000 ms to ~275 ms (~69×). Mentions array improvements in PowerShell 7.5 PR 23901, demos batching with Queue, undo with Stack, and handling millions of items (3 million tenant) to prove when each collection actually scales.
AI-written summary · about
chapters (22)
- 0:00PowerShell collections intro
- 1:12Arrays fixed size limits
- 2:39ArrayList legacy issues
- 3:21Lists modern replacements
- 5:53Array performance demo
- 8:44PowerShell 7.5 array performance improvements
- 11:33Generic lists type safety
- 13:00List operations methods
- 17:04Hash tables dictionaries
- 21:41Hash sets deduplication
- 23:48Hash table benchmarks
- 27:24Dictionary try get value method
- 29:49Group-Object with hashes
- 31:38Hash set deduplication demo
- 35:40Hash set set operations
- 36:44Hash set contains speed
- 38:10CSV columns with hash sets
- 40:15Queues and stacks
- 42:22Queue batch processing
- 47:48Stack undo operations
- 49:34Decision tree for collection selection
- 50:15Closing Q&A
related talks
34mWhip Your Scripts into Shape: Optimizing PowerShell for Speed
01h 31mThe Full Show
43mParallel Execution with PowerShell
01h 33mFinding Performance Bottlenecks with PowerShell
40mA Practical Guide to Streamlined Data Management and...
27mLeverage Multi-Threading for Speeding Up Your Scripts
01h 03mThe Zen of Powershell - PowerShell for the C# dev
32mWhat the game industry taught me about performance
