diff options
author | Miguel de Icaza <miguel@gnome.org> | 2003-07-19 01:53:26 +0400 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2003-07-19 01:53:26 +0400 |
commit | 7e130bc6d8cc35e2d059dc1d3ddbde72d1a6336f (patch) | |
tree | ffd527a98a9d15859406d52023db21f1bb0b2311 | |
parent | 09941fc6ec3e645722b40e4bb43420f93d56e7a2 (diff) |
2003-07-18 Miguel de Icaza <miguel@ximian.com>
* namespace.cs (Namespace, Name): Do not compute the namespace
name dynamically, compute it in the constructor. This reduced
memory usage by 1697 KB.
* driver.cs: Use --pause to pause at the end.
svn path=/trunk/mcs/; revision=16417
-rwxr-xr-x | mcs/mcs/ChangeLog | 8 | ||||
-rwxr-xr-x | mcs/mcs/cs-tokenizer.cs | 4 | ||||
-rwxr-xr-x | mcs/mcs/decl.cs | 7 | ||||
-rwxr-xr-x | mcs/mcs/namespace.cs | 16 |
4 files changed, 28 insertions, 7 deletions
diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index 8cdd9ef33c6..899a2f6cdba 100755 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,3 +1,11 @@ +2003-07-18 Miguel de Icaza <miguel@ximian.com> + + * namespace.cs (Namespace, Name): Do not compute the namespace + name dynamically, compute it in the constructor. This reduced + memory usage by 1697 KB. + + * driver.cs: Use --pause to pause at the end. + 2003-07-17 Peter Williams <peter@newton.cx> * Makefile: Change the name of the test target so that it doesn't diff --git a/mcs/mcs/cs-tokenizer.cs b/mcs/mcs/cs-tokenizer.cs index 351edc585cf..de90a126fba 100755 --- a/mcs/mcs/cs-tokenizer.cs +++ b/mcs/mcs/cs-tokenizer.cs @@ -1568,6 +1568,10 @@ namespace Mono.CSharp string ids = new String (id_builder, 0, pos);
+ //
+ // Optimization: avoids doing the keyword lookup
+ // on uppercase letters and _
+ //
if (s >= 'a'){
int keyword = GetKeyword (ids);
if (keyword == -1 || quoted){
diff --git a/mcs/mcs/decl.cs b/mcs/mcs/decl.cs index dbb84032d60..602f411bcf8 100755 --- a/mcs/mcs/decl.cs +++ b/mcs/mcs/decl.cs @@ -1348,6 +1348,13 @@ namespace Mono.CSharp { if (applicable == null) return MemberList.Empty; + // + // 32 slots gives 53 rss/54 size + // 2/4 slots gives 55 rss + // + // Strange: from 25,000 calls, only 1,800 + // are above 2. Why does this impact it? + // ArrayList list = new ArrayList (); Timer.StartTimer (TimerType.CachedLookup); diff --git a/mcs/mcs/namespace.cs b/mcs/mcs/namespace.cs index 9d6a3a9f2df..3271605a957 100755 --- a/mcs/mcs/namespace.cs +++ b/mcs/mcs/namespace.cs @@ -19,7 +19,7 @@ namespace Mono.CSharp { static ArrayList all_namespaces = new ArrayList (); Namespace parent; - string name; + string name, fullname; ArrayList entries; Hashtable namespaces; @@ -33,6 +33,13 @@ namespace Mono.CSharp { this.name = name; this.parent = parent; + string pname = parent != null ? parent.Name : ""; + + if (pname == "") + fullname = name; + else + fullname = parent.Name + "." + name; + entries = new ArrayList (); namespaces = new Hashtable (); @@ -88,12 +95,7 @@ namespace Mono.CSharp { /// </summary> public string Name { get { - string pname = parent != null ? parent.Name : ""; - - if (pname == "") - return name; - else - return String.Concat (parent.Name, ".", name); + return fullname; } } |