Devoncarew fix slowdown

@gaurave

Fix a performance issue when opening files when there are a lot of files in the workspace. I'm going to be in and out of communication today. If this looks good, feel free to merge it in yourself.