getsentry / rrweb

record and replay the web
https://www.rrweb.io/
Other
9 stars 5 forks source link

ref: Avoid cloning events to add `timestamp` #124

Closed mydea closed 8 months ago

mydea commented 9 months ago

We are always passing in fresh objects to this method, so instead of cloning this into a new object, we can just put the timestamp on the given object directly and return it, saving a bit of processing cost.

mydea commented 9 months ago

Upstream PR: https://github.com/rrweb-io/rrweb/pull/1339

github-actions[bot] commented 8 months ago

size-limit report 📦

Path Size
rrweb - record only (gzipped) 22.82 KB (-1% 🔽)
rrweb - record only (min) 80 KB (-0.97% 🔽)
rrweb - record with treeshaking flags (gzipped) 15.63 KB (-1.4% 🔽)