You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement deepCopy as copying, instead of merge (#742)
Currently `deepCopy` and `clone` create an empty message, and then merge the
cloned message into the empty message.
This is slow as merge needs to validate each element added to the message.
In this PR we instead directly copy the field set, and deeply copy map, list,
and message fields.
deepCopy benchmark results:
| | Before | After | Diff |
|------------------|---------|---------|--------|
| AOT | 238 us | 151 us | -36% |
| dart2js -O4 | 242 us | 140 us | -42% |
| dart2wasm -O2 | 230 us | 123 us | -46% |
| JIT | 189 us | 104 us | -44% |
This CL is tested internally in cl/794080754.
Fixes#60.
0 commit comments