krzysztofzablocki / LinkedConsole

Clickable links in your Xcode console, so you never wonder which class logged the message.
http://merowing.info
MIT License
931 stars 63 forks source link

Add a cache of looked-up filenames. #15

Closed ewanmellor closed 8 years ago

ewanmellor commented 8 years ago

This avoids performing the find every time. This cache doesn't get cleared since there's not an easy hook for doing that. To avoid permanently-bad cache entries, we at least check that the file still exists before returning that as a result.

This PR is dependent upon PR #14.

krzysztofzablocki commented 8 years ago

I don't think cache should be global object, as you can run multiple projects in a single Xcode instance. I thought about caching before, but I didn't see much of performance hit even in big projects, did you?

ewanmellor commented 8 years ago

The cache is keyed by workspacePath, so having it as a global object is OK I think. There's nowhere to put a per-project cache anyway, is there?

I definitely see a perf improvement with this. It's only a short glitch without it but it's enough that I noticed it.

krzysztofzablocki commented 8 years ago

ah I missed the workspacePath used as sub, looks good then :)

krzysztofzablocki commented 8 years ago

big thanks for contributing those 2 pr's @ewanmellor :)

ewanmellor commented 8 years ago

Thanks for writing this plugin in the first place :)