Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String operations in C#
07-14-2010, 04:55 AM (This post was last modified: 07-16-2010 09:20 AM by admin.)
Post: #1
String operations in C#
In order to match my derivatives calculators with Maple I began to rebuild string operations in my program. First I tried to compare relative speed of operations with String and StringBuilder objects. StringBuilder is kind of emulating C++ style because memory is allocated similar to alloc command in C and symbols are handled as char array. The beginning was inspiring: concatenation was thousands time faster for StringBuilder. The second test was disappointing: Replace operation was only twice faster for StringBuilder. Then Remove was much faster for StringBuilder. Insertion was twice faster in StringBuilder.
On other hand StringBuilder gives effect only for thousands of operations in loop. I use a lot of recursive procedures that use just a few string concatenations. To unify all procedures into one with loops? But mathematics by nature is recursive. After all the whole point of using C# is to concentrate on mathematics and leave memory management to Microsoft.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
String operations in C# - admin - 07-14-2010 04:55 AM
RE: String operations in C# - admin - 08-06-2010, 07:30 AM
RE: String operations in C# - wowadmin - 12-17-2012, 11:06 AM
RE: String operations in C# - admin - 12-18-2012, 12:44 AM

Forum Jump:


Contact Us | Tvlax home | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication