Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should give <a href="http://ahmadsoft.org/ropes/" rel="nofollow noreferrer">ropes</a> a try. The site is skimpy on details, but there's a great article <a href="http://www.ibm.com/developerworks/java/library/j-ropes/index.html" rel="nofollow noreferrer">here</a> with a better description and some good <a href="http://www.ibm.com/developerworks/java/library/j-ropes/index.html#fig4" rel="nofollow noreferrer">benchmarks comparing append performance</a>.</p> <p>I haven't actually used the ropes package, haven't had a good enough excuse to. Looks promising, though.</p> <p><b>Edit: Additional benchmark info</b></p> <p>I downloaded the <code>PerformanceTest</code> class from the ropes article, and added tests for <code>StringBuilder</code> in addition to <code>StringBuffer</code>. The performance improvement of <code>StringBuilder</code> seems negligible.</p> <p>I downloaded the test code from the ropes article and changed the test to include <code>StringBuilder</code> and <code>StringBuffer</code>.</p> <pre> Append plan length: 260 [StringBuilder] Average= 117,146,000 ns Median= 114,717,000ns [StringBuffer] Average= 117,624,400 ns Median= 115,552,000ns [Rope] Average= 484,600 ns Median= 483,000ns Append plan length: 300 [StringBuilder] Average= 178,329,000 ns Median= 178,009,000ns [StringBuffer] Average= 217,147,800 ns Median= 216,819,000ns [Rope] Average= 252,800 ns Median= 253,000ns Append plan length: 500 [StringBuilder] Average= 221,356,200 ns Median= 214,435,000ns [StringBuffer] Average= 227,432,200 ns Median= 219,650,000ns [Rope] Average= 510,000 ns Median= 507,000ns </pre> <p>The difference between StringBuilder and StringBuffer isn't that great. For the task at hand, Ropes seem like a clear win here.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload