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
Normally we use a random ID for new records. This can lead to duplicates when importing data: the same data can be imported twice, resulting in duplicate records with different IDs but the same information.
This could be done in a few ways, but we think the best would be to do something like this:
Hash the object into some stable ID.
Use that ID instead of the random one to avoid duplicates
I'm wondering if this should apply to icons. I don't know about performance, but we're embedding the icon blobs into the doc itself, so wouldn't hashing be slow for icons?
On my slower laptop (with a ~2.3GHz 4-core Intel processor), this takes about 3 seconds. On my faster machine (a 3.5GHz 16-core AMD processor), this takes about 550 milliseconds.
This is a bit slow, but (1) this is a giant icon file (2) my code is unoptimized. A more realistic (but still large) 1MiB file finishes in just 10ms on my slower machine, and about 4ms on my faster one.
Personally, I think that's acceptable. Does that seem okay to you?
Description
Normally we use a random ID for new records. This can lead to duplicates when importing data: the same data can be imported twice, resulting in duplicate records with different IDs but the same information.
This could be done in a few ways, but we think the best would be to do something like this:
Here's some sample object code:
We discussed doing this more generally in #507 but decided to do this only for config imports for now.
Tasks
The text was updated successfully, but these errors were encountered: