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

Skip three iteration of rFA cycles and process queues in 4th iteration. #54

Merged
merged 1 commit into from
Jun 28, 2017

Conversation

SparshithNR
Copy link
Collaborator

@SparshithNR SparshithNR commented Jun 22, 2017

#52: first phase of improvement, skipped three iteration of the rFA

@@ -16,6 +16,7 @@ export class Engine implements EngineInterface {
private reads: Array<Function> = [];
private work: Array<Function> = [];
private running: Boolean = false;
private skipCounter: number = 4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you create a const at top of file named something like NUM_SKIPPED_FRAMES or something like that?

Copy link
Contributor

@asakusuma asakusuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks nice, just a couple comments

@@ -40,13 +40,13 @@ testModule('Watcher Exposed Event', class extends WatcherTestClass {
['@test should fire twice if moved in, out, and then back in viewport']() {
return this.context.scrollTo(100)
.scrollTo(140)
.wait(RAF_THRESHOLD)
.wait(RAF_THRESHOLD * 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's more clear to keep RAF_THRESHOLD=16 and then do RAF_THRESHOLD * 4 here, since 4=skipCounter.

@@ -4,7 +4,8 @@ const constants = {
RAF_THRESHOLD : 16,
SMALL: 5
},
ITEM_TO_OBSERVE: 5
ITEM_TO_OBSERVE: 5,
SKIP_CYCLE: 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly is SKIP_CYCLE?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Number RAF cycles we are skipping

Copy link
Collaborator Author

@SparshithNR SparshithNR Jun 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I change the name consistent with src/engine.ts constant? I nameed it as NUM_SKIPPED_FRAMES in src/engine.ts and Should I use same constant name in test files as well to avoid confusion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Also, SKIP_CYCLE is 3 and NUM_SKIP_CYCLES is 4. Shouldn't they be the same?

Copy link
Collaborator Author

@SparshithNR SparshithNR Jun 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We basically skip 3 cycles and 4th one we enter the processing. I understand the confusion here. I will update those two be consistent.

@asakusuma
Copy link
Contributor

Looks good, @SparshithNR can you just squash into one commit? then I'll merge

@SparshithNR SparshithNR changed the title #50 #52 Jun 28, 2017
@asakusuma asakusuma merged commit ef26153 into linkedin:master Jun 28, 2017
@SparshithNR SparshithNR changed the title #52 Skip three iteration of rFA cycles and process queues in 4th iteration. Jul 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants