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

Lazily allocate observables #2387

Closed
cramforce opened this issue Mar 2, 2016 · 1 comment · Fixed by #6496 or #6839
Closed

Lazily allocate observables #2387

cramforce opened this issue Mar 2, 2016 · 1 comment · Fixed by #6496 or #6839

Comments

@cramforce
Copy link
Member

E.g.

this.touchDetectedObservable_ = new Observable();

We should optimize memory usage for cases where never anything registers, or were registration is rare or non-immediate.

@cramforce
Copy link
Member Author

I think the best win would be to avoid the array allocation here https://github.com/ampproject/amphtml/blob/master/src/observable.js#L28 so that unused observables only cost one object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment