[Mono-bugs] [Bug 71413][Nor] Changed - Path.GetFullPath is heavy on string allocations
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
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 bmaurer@users.sf.net.
http://bugzilla.ximian.com/show_bug.cgi?id=71413
--- 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 @@
Bug#: 71413
Product: Mono: Class Libraries
Version: 1.1
-OS:
+OS: unknown
OS Details:
Status: NEW
Resolution:
-Severity:
+Severity: Unknown
Priority: Normal
Component: CORLIB
AssignedTo: mono-bugs@ximian.com
ReportedBy: joeshaw@novell.com
QAContact: mono-bugs@ximian.com
TargetMilestone: ---
@@ -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 bmaurer@users.sf.net 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:
+
+/home/benm/blah
+/home/benm/foo
+/home/benm/bar
+You can store `/home/benm/' in memory once, and save some ram there.