Gordon Smith wrote:
Forget StringBuilder... it's going away in B3. The player team decided it didn't give enough performance gain in enough useful cases to justify having both String and StringBuilder. Doh, really? I've actually been using it a decent amount. It's especially handy in testing the SHA1 hash of a million letter a's to verify the hash algorithm is correct: var millionAs:StringBuilder = new StringBuilder( '' ); millionAs.ensureCapacity( 1000000 ); for ( var i:int = 0; i < 1000000; i++ ) { millionAs.append( 'a' ); } assertSHA1( millionAs.toString(), "34aa973cd4c4daa4f61eeb2bdbad27316534016f" ); I realize the above loop could be unrolled to make it perform even faster (by appending more 'a's in each append call, and reducing the number of iterations by 10x, 100x, etc). But StringBuilder in this case was a lot faster than using a regular string.. though, I imagine this isn't really a typical use-case. That said, however, it would be a shame to see StringBuilder go -- especially after having written a decent number of pages for it for an upcoming book. Can I petition? :-) -d
YAHOO! GROUPS LINKS
|
- Re: [flexcoders] AS3 :: Multiline RegExp declarations :: ... Michael Schmalle
- Re: [flexcoders] AS3 :: Multiline RegExp declaration... JesterXL
- Re: [flexcoders] AS3 :: Multiline RegExp declaration... Darron J. Schall
- Re: [flexcoders] AS3 :: Multiline RegExp declaration... Darron J. Schall
- [flexcoders] Adobe Best Practices: Deprecate/Rem... dos dedos
- RE: [flexcoders] Adobe Best Practices: Depre... Matt Chotin
- RE: [flexcoders] AS3 :: Multiline RegExp declara... Matt Chotin
- Re: [flexcoders] AS3 :: Multiline RegExp dec... Michael Schmalle
- RE: [flexcoders] AS3 :: Multiline RegExp declara... Gordon Smith
- Re: [flexcoders] AS3 :: Multiline RegExp dec... Michael Schmalle
- Re: [flexcoders] AS3 :: Multiline RegExp... Michael Schmalle