McNeight / tar-cs

Automatically exported from code.google.com/p/tar-cs
Other
0 stars 1 forks source link

Ineffecient padding function #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, I noticed that a memory profile indicates the function TarHeader.AddChars() 
is creating too many allocations.  A new string is being created for each 
character added.

This function may be removed because there is a built-in .NET string function 
that does the same:  String.PadLeft() or String.PadRight().

http://msdn.microsoft.com/en-us/library/92h5dc07.aspx

Original issue reported on code.google.com by sbana...@gmail.com on 28 Apr 2011 at 11:35

GoogleCodeExporter commented 8 years ago
Great. Thank you. Do you have a patch for that?

Original comment by vasilt...@gmail.com on 17 Jun 2011 at 8:34

GoogleCodeExporter commented 8 years ago
Yes, I've attached 2 patches of changes i made to my copy of tar-cs.

The first patch (padding.patch) has the changes as mentioned above.

The second patch (otherstuff.patch) has even further changes of various things, 
so I figure I'll pass it along.  Not sure they are necessary, they were mostly 
attempts to clean up stuff.  The important changes are in the first patch. 

Original comment by sbana...@gmail.com on 17 Jun 2011 at 10:26

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks!

Original comment by vasilt...@gmail.com on 9 Feb 2012 at 2:54