[Mono-bugs] [Bug 71413][Nor] Changed - Path.GetFullPath is heavy on string allocations
Tue, 18 Jan 2005 14:52:22 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by email@example.com.
--- shadow/71413 2005-01-18 14:22:08.000000000 -0500
+++ shadow/71413.tmp.28597 2005-01-18 14:52:22.000000000 -0500
@@ -1,14 +1,14 @@
Product: Mono: Class Libraries
@@ -27,6 +27,24 @@
smarter when looking for multiple path separators and . and ..
Of the 1.1 megs I was able to shave off half of it thanks to
conditionalizing the call with Path.IsPathRooted, but the other half is
still there because it's called in the constructor for DirectoryInfo. Can
we eliminate that call? Or at least optimize Path.GetFullPath.
+------- Additional Comments From firstname.lastname@example.org 2005-01-18 14:52 -------
+Well, the allocations made are temporary. We are not using
+stringbuilders, so there is no bloat in the strings.
+One thing that i did notice is that GetCurrentDirectory returns a
+different string each time. We might want to smartly cache the value
+from the last call.
+In Beagle, you can use a clever little trick to reduce memory usage:
+Store the path as a combo of directory name and file name. This way,
+if you have:
+You can store `/home/benm/' in memory once, and save some ram there.