Slow string concatenation over large input

前端 未结 6 779
醉酒成梦
醉酒成梦 2021-01-12 13:47

I\'ve written an n-ary tree ADT which works fine. However, I need to store its serialization in a variable a calling class. eg.

    DomTree a         


        
6条回答
  •  不思量自难忘°
    2021-01-12 14:13

    You might want to look at String.intern() as a way to cut down on memory use. This will use the interned String from the string pool. If you have many duplicated strings, it might be faster. More info on interned strings here

提交回复
热议问题