3 ms·
I bet that if someone who knew what they were doing decided to optimize that, you'd get the cost WAY down, possibly almost to zero. (If you are using std::strin
by jblow 11y ago
I bet that if someone who knew what they were doing decided to optimize that, you'd get the cost WAY down, possibly almost to zero. (If you are using std::string, that is your problem right there).
But the very important difference here is that in your case you have a choice and it is possible to optimize the cost away and to otherwise control the characteristics of wheyou pay this cost. In GC systems it is never possible to do this completely. You can only sort of kind of try to prevent GC. It's not just a difference in magnitude, it's a categorical difference.
- reagency 11y agoIf you really really want to, you can allocate a buffer for all your data.
- obstinate 11y agoThis solves little. What do you think the system allocator is doing under the covers?
- SamReidHughes 11y agoIt's doing a lot less, if you're allocating one buffer for your data instead of many.
- obstinate 11y agoPerhaps. The team is a group of seasoned veterans of high performance server engineering. But perhaps there are others who could improve on our efforts by a significant margin. Of course we do not use std::string.