Netduino home hardware projects downloads community

Jump to content


Photo

is Stringbuilder using ArrayList ?


  • Please log in to reply
1 reply to this topic

#1 asciiman

asciiman

    Advanced Member

  • Members
  • PipPipPip
  • 56 posts
  • LocationTurkey

Posted 07 March 2015 - 01:50 PM

Hi,

 

?s stringbuilder using Arraylist?

 

http://neuromancer.i...rk-collections/

 

One main point to consider when using collections in a micro framework device is that of memory consumption. Each collection carries overhead data that serves no other purpose than to facilitate the items you store in the collection. For example, inserting hundreds of items in an ArrayList will quickly use up most of the memory on a Netduino.



#2 jinzai

jinzai

    Member

  • Members
  • PipPip
  • 11 posts
  • LocationDavenport, IA

Posted 02 June 2015 - 06:06 AM

Microsoft's documentation seems to imply that it does not. (If it did, you would need a reference to any collection it used, which is not a great way to develop libraries that do not have unnecessary dependencies.)

 

It is more likely that it is built upon fairly standard string manipulation techniques, where a new string is generated each time you perform an operation on a string. It maintains a buffer that changes size when you Append, for example.

 

I think that StringBuilder is pretty efficient for use in typical applications on Netduino.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.