Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Investigate GuessZoneIdByTransitionsUncached performance #686
Basically, there's a lot we could optimize here. Will look at how reasonable it is to do so.
Cost of adding in five extra calls within the inner
Further observation - we're making the expensive
Now adding code to give up as soon as we know we should...
Ha - fresh observation... this line:
var candidates = CanonicalIdMap.Values.Select(ForId).ToList()
... takes about half the time of the test! That should be somewhat expected, given that a time zone source doesn't implement caching.
Next observation: this method is only called in non-test code via
Final result: let's avoid being completely gratuitous with
referenced this issue
Mar 10, 2017
added a commit
Mar 12, 2017
Just worked out how to improve this massively. Much of the problem is that we reload the time zones from raw data on each iteration. If we move this line of code:
var candidates = CanonicalIdMap.Values.Select(ForId).ToList();
Not only does that save us the time of loading, but it means that after the first test, the caches will all be populated.