The Wayback Machine - https://web.archive.org/web/20220425223800/https://github.com/pmusolino/Wormholy/issues/96
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance degratation in CustomSelfAwareHelper.harmlessFunction() #96

Closed
dsaitta0 opened this issue Nov 5, 2020 · 1 comment · Fixed by #105
Closed

Performance degratation in CustomSelfAwareHelper.harmlessFunction() #96

dsaitta0 opened this issue Nov 5, 2020 · 1 comment · Fixed by #105
Labels
good first issue

Comments

@dsaitta0
Copy link

@dsaitta0 dsaitta0 commented Nov 5, 2020

Hi,

I saw that there is a perfomance degratation due to a for loop used inside the static func harmlessFunction() declared in CustomSelfAwareHelper struct.

This loop is trying to verify the type with the as? operator (that have a complexity of O(n) ) and try to unwrapp the result in order to call the awake() function.

For a medium-larger project (with likely 20k+ classes) that covers old iDevices (like iPhone 5, 5S or 6) this means that the app launch phase could take a lot and should cause crashes if other frameworks needs to do an initialization in the application start up phase .

I saw also that in this project there is only one extension (on Wormholy.swift:109) that implements the type mentioned above (SelfAware): I think it would be nice to replace the for loop with a direct call to the awake() function implemented in the Wormholy externsion.

Let me know

Cheers

Daniele

@pmusolino pmusolino added the good first issue label Nov 27, 2020
@pmusolino
Copy link
Owner

@pmusolino pmusolino commented Nov 27, 2020

Thank you Daniele for opening this issue. Are you using the latest version released 1.6.3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue
2 participants