gskinnerTeam / flokk

A fresh and modern Google Contacts manager that integrates with GitHub and Twitter.
https://flokk.app
BSD 2-Clause "Simplified" License
1.46k stars 271 forks source link

Question: Does static instance of context make a perf difference #36

Closed chimon2000 closed 4 years ago

chimon2000 commented 4 years ago

I noticed that the AbstractCommand checks to see if the context passed into the constructor matches a previously passed in context.

https://github.com/gskinnerTeam/flokk/blob/861553120f153a6cba8bf262d6fc02002234469b/flokk_src/lib/commands/abstract_command.dart#L25-L30

Wondering whether this done purely for perf gains, and if so how noticeable is the difference?

esDotDev commented 4 years ago

No, its just done because Provider will yell at us if we pass the top level context. Afaik there is virtually no overhead with these lookups.