Friday, 4 May 2012

F# Map vs .NET Dictionary performance

Visual F# 2010 for Technical Computing pages 241-242 "Optimization: Use mutable data structures" shows a Dictionary running 5-40× faster than a Map in the very similar setting of counting the frequencies on ints as a function of the number of unique keys.
In general, purely functional data structures like Map are not only extremely slow in the serial case but they destroy scalability of entire parallel programs. See this lecture.

No comments: