Make the mkbundle output more dense to speed up assembly.
authorZoltan Varga <vargaz@gmail.com>
Thu, 18 Apr 2013 20:27:17 +0000 (22:27 +0200)
committerZoltan Varga <vargaz@gmail.com>
Thu, 18 Apr 2013 20:27:17 +0000 (22:27 +0200)
mcs/tools/mkbundle/mkbundle.cs

index 5f9370cb71b16e4322c77ff66c93b429b4f3b309..3ddf7289ab4e3a229b01343ce15537aff8e726ba 100644 (file)
@@ -232,12 +232,20 @@ class MakeBundle {
                // Preallocate the strings we need.
                if (chars [0] == null) {
                        for (int i = 0; i < chars.Length; i++)
-                               chars [i] = string.Format ("\t.byte {0}\n", i.ToString ());
+                               chars [i] = string.Format ("{0}", i.ToString ());
                }
 
                while ((n = stream.Read (buffer, 0, buffer.Length)) != 0) {
-                       for (int i = 0; i < n; i++)
+                       int count = 0;
+                       for (int i = 0; i < n; i++) {
+                               if (count % 32 == 0) {
+                                       ts.Write ("\n\t.byte ");
+                               } else {
+                                       ts.Write (",");
+                               }
                                ts.Write (chars [buffer [i]]);
+                               count ++;
+                       }
                }
 
                ts.WriteLine ();
@@ -282,7 +290,6 @@ class MakeBundle {
                        // Do the file reading and compression in parallel
                        Action<string> body = delegate (string url) {
                                string fname = new Uri (url).LocalPath;
-
                                Stream stream = File.OpenRead (fname);
 
                                long real_size = stream.Length;