4 ms·
Huh. If I found that Reflection::ListFieldsMayFailOnStripped was a frequent caller of std::sort, to an extent that it was actually costing measurable CPU time,
by jeffbee 5y ago
Huh. If I found that Reflection::ListFieldsMayFailOnStripped was a frequent caller of std::sort, to an extent that it was actually costing measurable CPU time, first thing I would do is find and fix all callers of that.
- gipp 5y ago"Fix" how exactly? I'm not quite sure what you're suggesting.
- jeffbee 5y agoC++ proto reflection is a convenience. If it actually shows up at scale in production, that smells like a design error.
- moultano 5y agoAll things show up at scale in production at Google.
- jeffbee 5y agoIn one sense yes, but in another sense even though Google is large their threshold for something being worth fixing based on efficiency justifications is correspondingly large.
- foota 5y agoFrequently though, you're dealing with a death by a thousand paper cuts. Perhaps that call comes from some common library whose implementation requires reflection.
- moultano 5y agoIt isn't though. A typical developer will never care about 0.1% of unnecessary CPU usage in their application, but at Google, depending on what component it's in, that can easily be a million dollar find.
- jcelerier 5y ago> In one sense yes, but in another sense even though Google is large their threshold for something being worth fixing based on efficiency justifications is correspondingly large. not everything is a linear relationship
- usefulcat 5y agoIf you're measuring in terms of time, electricity, or hardware, then the threshold would tend to be lower for Google, not higher. A 0.1% savings on a million machines is ~1 million times more valuable than a 0.1% savings on a single machine. OTOH if the measurement is risk of breaking something, then it's not nearly so clear, since larger organizations tend to have more software and hardware, and therefore more opportunities for things to get broken.
- jeffbee 5y agoYou're saying the opposite of what the other guy said, though. They said that at scale small things are big. I'm saying that at scale .001% is still .001%.