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

Sync performance fixes #1921

Merged
merged 20 commits into from
Dec 30, 2020
Merged

Sync performance fixes #1921

merged 20 commits into from
Dec 30, 2020

Conversation

prabhanshuguptagit
Copy link
Contributor

@prabhanshuguptagit prabhanshuguptagit commented Dec 25, 2020

Story card: 2086

Because

We discovered that the perf improvements for block level sync tend to slow down FG syncing. We reverted the improvements (#1920) to unblock deploys while a fix was figured out.

This addresses

This combines the reverted perf improvements (#1898 and #1897) and fixes them to be FG compatible.

Note

Please use #1926 as reference for the changes here.

@harimohanraj89 harimohanraj89 temporarily deployed to simple-review-pr-1921 December 25, 2020 15:26 Inactive
@kitallis kitallis mentioned this pull request Dec 28, 2020
6 tasks
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 28, 2020 12:56 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 28, 2020 14:06 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 29, 2020 07:17 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 29, 2020 07:26 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 29, 2020 08:02 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 29, 2020 08:04 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 29, 2020 10:49 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 29, 2020 12:26 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 29, 2020 15:23 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 29, 2020 15:42 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 29, 2020 16:10 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 29, 2020 18:28 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 30, 2020 06:40 Inactive
@kitallis kitallis marked this pull request as ready for review December 30, 2020 07:25
end
end

# this is performance-critical code, be careful while refactoring it
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's link to the issue in this comment too.

@@ -90,5 +92,13 @@ def sync_region_modified?
return if process_token[:sync_region_id].blank?
process_token[:sync_region_id] != requested_sync_region_id
end

def time(method_name, &block)
raise ArgumentError, "You must supply a block" unless block
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this necessary? Can we just let the yield below blow up with a Block not provided?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, right, of course 👍🏼

Copy link
Contributor

@harimohanraj89 harimohanraj89 left a comment

Choose a reason for hiding this comment

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

I think we've done a ton of research and test driving of these changes. They look good!

I have one crazy idea - what happens if we replace current_facility_records and other_facility_records with current_facility_records and all_facility_records?

Sure, we'll be sending the current facility records twice, but is that worth it - given the alternative is a gnarly codepath that requires cautionary comments and performance observation every time we touch it?

@harimohanraj89 harimohanraj89 temporarily deployed to simple-review-pr-1921 December 30, 2020 08:52 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 30, 2020 11:19 Inactive
@kitallis kitallis temporarily deployed to simple-review-pr-1921 December 30, 2020 11:24 Inactive
@kitallis kitallis merged commit 92a6b59 into master Dec 30, 2020
@kitallis kitallis deleted the sync-perf-fixes branch December 30, 2020 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants