Replace \SplObjectStorage with normal array to fix performance problems