Conversation
Co-authored-by: AdamShwert <adamshwert@github.com> Co-authored-by: Arelia Jones <2359538+arelia@users.noreply.github.com> Co-authored-by: Chris Gavin <chris@chrisgavin.me> Co-authored-by: Cody Bodfield <cbodfield@github.com> Co-authored-by: Dusty Greif <dgreif@users.noreply.github.com> Co-authored-by: Elena Tanasoiu <elenatanasoiu@github.com> Co-authored-by: Erinna Chen <erinnachen@users.noreply.github.com> Co-authored-by: Francesco Manni <72417313+francescomanni@users.noreply.github.com> Co-authored-by: Jibran Garcia <jibrang@github.com> Co-authored-by: Mamadou Coulibaly <106176387+chief-coulibaly@users.noreply.github.com> Co-authored-by: Ned Schwartz <ned@theinterned.net>
623860d to
bd69f5d
Compare
Co-authored-by: Kristján Oddsson <koddsson@gmail.com>
8cc9495 to
3a8e33a
Compare
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.
In our mob pairing session called "Making Dotcom Fast" we ran into an issue where we're calling
lazyDefineover 200 times in quick succession. This becomes quite expensive ascancelAnimationFrameis O(n) and we're calling it 200 times meaning we end up with thousands of iterations that ultimately do nothing.In order to prevent this cost on page load, we can overload
lazyDefineto take an object of element->callback pairs, meaning we only callobserve()once. This then needs a tiny refactor on the consumer side, but it turns this:into this: