Foreign.Marshal.Pool functions use inefficient O(n) operations
Data.List.elem to determine whether a pointer is already in the pool and to delete them, as a result of
newtype Pool = Pool (IORef [Ptr ()]).
Thus repeated operations on pools with many entries can become very slow.
If possible, we might consider using
Ord on the
Ptr and an O(log n) data structure instead of a
Alternatively, we should warn in the docs that this is the case, but it seems better to just fix the implementation.