Set tracking traits of template class in boost serialization to reduce memory consumption

好久不见. 提交于 2019-12-03 21:12:41

UPDATE

OP has since posted the synthetic benchmark that does show the thing he is trying to measure.

I ran it under Massif, twice: on the left just building a large Tree, and on the right also serializing it: https://gist.github.com/sehe/5f060a3daccfdff3178c#file-sbs-txt

Note how memory usage is basically exactly identical: object tracking is not an issue here

For comparison, when tracking is enabled: https://gist.github.com/8d3e5dba7b124a750b9b

Conclusion

Q. I used this macro in my code, but now I am not sure whether this macro prevent the class from tracking or not.

Yes. It clearly does.


Original footnote from old answer:

¹ No it would not usually be double the amount of memory - that would take a very specific kind of data set with a very low payload-to-trie-node size ratio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!