-
Notifications
You must be signed in to change notification settings - Fork 129
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
RUM-1507 Improved diffing #1524
Conversation
Datadog ReportBranch report: ✅ |
return hash | ||
} | ||
|
||
private func computeHash() -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
Random question, do we have a benchmark on the improvement this cache is adding vs the time needed to md5 a full image data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hash is lazily computed once for each resource, so it shouldn't matter that much.
Optimisation of this PR happens in diffing algorithm which takes Hashable
protocol into account. In it's implementation we are now ignoring base64 field.
What you're asking here is going to happen in a Resource Endpoint PR where we stop calculating base64 and upload resources directly. In this next PR, I'll measure the difference.
What and why?
It leverages new
resourceId
field instead ofbase64
for calculating diff of image wireframes, speeds up the calculation and lowers the CPU pressure.How?
We added new field to SR schema (that will be later on used for different purposes) and started using this field instead of base64 to calculate object's hash.
Now, on Shopist it goes as low as 12% of CPU for the most complex view on idle. Used to be 60% before the change.
Review checklist
Custom CI job configuration (optional)
tools/