|
|
|
|
|
by broken_broken_
497 days ago
|
|
At work the Go backend was also using gob encoding in one case to store some values in the database.
After some profiling, I noticed it was the top allocation part of the whole app. It was also showing on the CPU performance profiles.
Finally some very light “fuzzing” (just a case were the wrong value was written to the database, and reading it back crashed the app) made me decide to rip it out and use JSON instead.
Instantly, this section of the code disappeared from all profiles.
I honestly do not understand why this format exists in the Go standard library and I would never use it.
There are plenty other formats available…and a decoder should never crash in the face of invalid data! |
|