Improve the performance of the lib#94
Merged
InderKumarRathore merged 25 commits intomasterfrom May 21, 2022
Merged
Conversation
Owner
Author
|
I ran the app using new library and subsequent launches are Old library was taking 10ms to get the info on subsequent calls on average, but new library was taking 1ms. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reading from plist every time is time consuming. Need to check how much time it takes to get the device name.
The idea to reduce the time are as follows
Save the device info in the user default keeping in mind that newer version of the lib can have updated names, enum etc. and update if there is new version.
Once we have updates info keep it in internal static variable and always return from it. This will reduce the memory imprint and would be much faster if new instance is created. Also will be faster in subsequent launches as the data will be read from user defaults.
Issue: #86
Update
I ran the app using new implementation and subsequent launches are
10xfaster than older implementation.Old implementation was taking 10ms to get the info on subsequent calls on average, but new implementation was taking 1ms.
I checked the memory although it was low but not significant compared to the app. The only advantage is that now in new implementation we don't keep plist data(dictionary) in the memory