slow List.add -> slow StringBuffer
Alex,what is the status of this issue? Did you/someone create an issue in Dart issue tracker? If so, can you post a link to it pls.?
Thanks
Dňa utorok, 19. augusta 2014 5:52:32 UTC+2 Alex Tatumizer napísal(-a):slow List.add -> slow StringBufferslow StringBuffer -> slow JSON.stringifyIt was one of dart's mysteries until now.In JSON.stringify, there's a lot of short strings added to StringBuffer.Quote, { ,}, [, ], comma are all added as 1-char Strings to StringBuffer, which, in turn, translates each call into List.addThe costs of these calls don't amortize if added Strings have only 1 char, or small number of chars.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
Can you share precisely the benchmark you are running?
I will take a look then.
(I see one benchmark in the first message of the thread, but that doesn't seem to cover sublist)
I think it's also time we start tracking (micro)performance of some library routines to make sure we don't regress.
On a side note: if the larger code, one that you think is suffering from List copying slowness is public - then I would love to take a look on that as well.
Thanks.
Let me just chime in with Alex regarding the the performance of parsing doubles. I have also ran into similar issues when parsing 100MB CSV files and did similar benchmarks with similar results. Any improvements on this front (as well as fast operations on typed arrays) would be greatly appreciated!
--
Interesting thing about double.parse is that it could be made lightning fast if implemented in pure dart using SIMD.Load 4 digits at a time into SIMD floating point register, multiply by vector [1, 10, 100, 1000], add horizontally twice.