Advertisement
kwp

String.Concat vs StringBuilder.Append [closed]

kwp
Apr 7th, 2015
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 22.44 KB | None | 0 0
  1. open System
  2. open System.Collections.Generic
  3. open System.Diagnostics
  4. open System.IO
  5. open System.Text
  6. open System.Threading
  7.  
  8. type ConcatMethod =
  9.     | None = 0
  10.     | StringBuilderAppend = 1
  11.     | StringConcat = 2
  12.  
  13. type TestResult =
  14.     { ConcatMethod   : ConcatMethod
  15.       StringLength   : int
  16.       Concatenations : int
  17.       Iterations     : int
  18.       Ticks          : int64 }
  19.  
  20.     override this.ToString() =
  21.         String.Format(@"""{0}"",""{1}"",""{2}"",""{3}"",""{4}""",
  22.             this.ConcatMethod,
  23.             this.StringLength,
  24.             this.Concatenations,
  25.             this.Iterations,
  26.             this.Ticks)
  27.  
  28. [<EntryPoint>]
  29. let main argv =
  30.  
  31.     Thread.CurrentThread.Priority <- ThreadPriority.Highest
  32.  
  33.     let sw, sb, results, output, score =
  34.         new Stopwatch(),
  35.         new StringBuilder(),
  36.         List<TestResult>(),
  37.         new StringBuilder(),
  38.         new Dictionary<ConcatMethod, int>()
  39.  
  40.     let resultFile, outputFile =
  41.         @"r:\result.csv",
  42.         @"r:\output.txt"
  43.  
  44.     score.Add(ConcatMethod.None, 0)
  45.     score.Add(ConcatMethod.StringBuilderAppend, 0)
  46.     score.Add(ConcatMethod.StringConcat, 0)
  47.  
  48.     let inline (~~) s =
  49.         output.AppendLine(s) |> ignore
  50.  
  51.     let TestStringConcat count length iterations =
  52.  
  53.         let s = new String('*', length)
  54.         let a = Array.create count s
  55.  
  56.         match count with
  57.         | 2 ->
  58.             sw.Restart()
  59.  
  60.             for n = 1 to iterations do
  61.                 String.Concat(s, s) |> ignore
  62.  
  63.             sw.Stop()
  64.  
  65.         | 3 ->
  66.             sw.Restart()
  67.  
  68.             for n = 1 to iterations do
  69.                 String.Concat(s, s, s) |> ignore
  70.  
  71.             sw.Stop()
  72.  
  73.         | 4 ->
  74.             sw.Restart()
  75.  
  76.             for n = 1 to iterations do
  77.                 String.Concat(s, s, s, s) |> ignore
  78.  
  79.             sw.Stop()
  80.  
  81.         | _ ->
  82.             sw.Restart()
  83.  
  84.             for n = 1 to iterations do
  85.                 String.Concat(a) |> ignore
  86.  
  87.             sw.Stop()
  88.  
  89.         results.Add(
  90.             {   ConcatMethod    =   ConcatMethod.StringConcat
  91.                 StringLength    =   length
  92.                 Concatenations  =   count
  93.                 Iterations      =   iterations
  94.                 Ticks           =   sw.ElapsedTicks })
  95.  
  96.         sw.ElapsedTicks
  97.  
  98.     let TestStringBuilder count length iterations =
  99.  
  100.         let s = new String('*', length)
  101.         let a = Array.create count s
  102.  
  103.         sw.Restart()
  104.  
  105.         for n = 1 to iterations do
  106.  
  107.             sb.Length <- 0
  108.  
  109.             for str in a do
  110.                 sb.Append(str) |> ignore
  111.  
  112.             sb.ToString() |> ignore
  113.  
  114.         sw.Stop()
  115.  
  116.         results.Add(
  117.             {   ConcatMethod    =   ConcatMethod.StringBuilderAppend
  118.                 StringLength    =   length
  119.                 Concatenations  =   count
  120.                 Iterations      =   iterations
  121.                 Ticks           =   sw.ElapsedTicks })
  122.  
  123.         sw.ElapsedTicks
  124.  
  125.     let minLen, maxLen, lenInc  =   2,  8,  2   // chars in string
  126.     let minNum, maxNum, numInc  =   2,  8,  1   // strings to concat
  127.     let minPow, maxPow, powInc  =   1,  6,  1   // iterations
  128.  
  129.     for length in [minLen..lenInc..maxLen] do
  130.  
  131.         for count in [minNum..numInc..maxNum] do
  132.  
  133.             let m = length * (count + 1)
  134.  
  135.             if m > sb.Capacity then
  136.                 sb.Capacity <- m
  137.  
  138.             for iterations in
  139.                 [
  140.                     for i in [minPow..powInc..maxPow] do
  141.                         yield Math.Pow(10., float i) |> int
  142.                 ]
  143.  
  144.                 do
  145.  
  146.                 let bticks = TestStringBuilder  count length iterations
  147.                 let cticks = TestStringConcat   count length iterations
  148.                 let dticks = Math.Abs(bticks-cticks)
  149.  
  150.                 let mutable winner = String.Empty
  151.  
  152.                 if bticks < cticks then
  153.                     winner <- "BUILDER"
  154.                     score.[ConcatMethod.StringBuilderAppend] <- score.[ConcatMethod.StringBuilderAppend] + 1
  155.  
  156.                 elif bticks > cticks then
  157.                     winner <- "CONCAT"
  158.                     score.[ConcatMethod.StringConcat] <- score.[ConcatMethod.StringConcat] + 1
  159.  
  160.                 else
  161.                     winner <- "TIED!"
  162.                     score.[ConcatMethod.None] <- score.[ConcatMethod.None] + 1
  163.  
  164.                 let current =
  165.                     String.Format(
  166.                         "Length: {0}, \
  167.                        Count: {1}, \
  168.                        Iterations: {2}, \
  169.                        Builder: {3}, \
  170.                        Concat: {4}, \
  171.                        Difference: {5}, \
  172.                        Winner: {6}",
  173.                         length,
  174.                         count,
  175.                         iterations,
  176.                         bticks,
  177.                         cticks,
  178.                         dticks,
  179.                         winner)
  180.  
  181.                 ~~ current
  182.  
  183.             ~~ String.Empty
  184.  
  185.     let bw = "Builder Win: " + score.[ConcatMethod.StringBuilderAppend].ToString()
  186.     let cw = " Concat Win: " + score.[ConcatMethod.StringConcat].ToString()
  187.     let tw = "       Tied: " + score.[ConcatMethod.None].ToString()
  188.  
  189.     output.Insert(0,
  190.         bw + Environment.NewLine +
  191.         cw + Environment.NewLine +
  192.         tw + Environment.NewLine +
  193.         Environment.NewLine) |> ignore
  194.  
  195.     ~~ bw
  196.     ~~ cw
  197.     ~~ tw
  198.  
  199.     File.WriteAllText(outputFile, output.ToString())
  200.  
  201.     sb.Length <- 0
  202.     sb.AppendLine(String.Format("\"ConcatMethod\",\"StringLength\",\"Concatenations\",\"Iterations\",\"Ticks\"")) |> ignore
  203.  
  204.     for result in results do
  205.         sb.AppendLine(result.ToString()) |> ignore
  206.  
  207.     File.WriteAllText(resultFile, sb.ToString())
  208.  
  209.     0
  210.  
  211. /*  RESULTS!
  212.  
  213.     -> Release, AnyCPU, Optimize Code
  214.     -> Run from command line, not from within Visual Studio Hosting Process
  215.  
  216. Builder Win: 83
  217.  Concat Win: 70
  218.        Tied: 15
  219.  
  220. Length: 2, Count: 2, Iterations: 10, Builder: 8, Concat: 2, Difference: 6, Winner: CONCAT
  221. Length: 2, Count: 2, Iterations: 100, Builder: 21, Concat: 4, Difference: 17, Winner: CONCAT
  222. Length: 2, Count: 2, Iterations: 1000, Builder: 105, Concat: 55, Difference: 50, Winner: CONCAT
  223. Length: 2, Count: 2, Iterations: 10000, Builder: 908, Concat: 625, Difference: 283, Winner: CONCAT
  224. Length: 2, Count: 2, Iterations: 100000, Builder: 9014, Concat: 3883, Difference: 5131, Winner: CONCAT
  225. Length: 2, Count: 2, Iterations: 1000000, Builder: 80656, Concat: 39268, Difference: 41388, Winner: CONCAT
  226.  
  227. Length: 2, Count: 3, Iterations: 10, Builder: 2, Concat: 1, Difference: 1, Winner: CONCAT
  228. Length: 2, Count: 3, Iterations: 100, Builder: 9, Concat: 5, Difference: 4, Winner: CONCAT
  229. Length: 2, Count: 3, Iterations: 1000, Builder: 89, Concat: 49, Difference: 40, Winner: CONCAT
  230. Length: 2, Count: 3, Iterations: 10000, Builder: 890, Concat: 484, Difference: 406, Winner: CONCAT
  231. Length: 2, Count: 3, Iterations: 100000, Builder: 9053, Concat: 4980, Difference: 4073, Winner: CONCAT
  232. Length: 2, Count: 3, Iterations: 1000000, Builder: 91385, Concat: 50987, Difference: 40398, Winner: CONCAT
  233.  
  234. Length: 2, Count: 4, Iterations: 10, Builder: 2, Concat: 2, Difference: 0, Winner: TIED!
  235. Length: 2, Count: 4, Iterations: 100, Builder: 11, Concat: 7, Difference: 4, Winner: CONCAT
  236. Length: 2, Count: 4, Iterations: 1000, Builder: 108, Concat: 61, Difference: 47, Winner: CONCAT
  237. Length: 2, Count: 4, Iterations: 10000, Builder: 1081, Concat: 608, Difference: 473, Winner: CONCAT
  238. Length: 2, Count: 4, Iterations: 100000, Builder: 11262, Concat: 6417, Difference: 4845, Winner: CONCAT
  239. Length: 2, Count: 4, Iterations: 1000000, Builder: 111022, Concat: 70856, Difference: 40166, Winner: CONCAT
  240.  
  241. Length: 2, Count: 5, Iterations: 10, Builder: 3, Concat: 6, Difference: 3, Winner: BUILDER
  242. Length: 2, Count: 5, Iterations: 100, Builder: 20, Concat: 32, Difference: 12, Winner: BUILDER
  243. Length: 2, Count: 5, Iterations: 1000, Builder: 211, Concat: 258, Difference: 47, Winner: BUILDER
  244. Length: 2, Count: 5, Iterations: 10000, Builder: 2261, Concat: 2267, Difference: 6, Winner: BUILDER
  245. Length: 2, Count: 5, Iterations: 100000, Builder: 16262, Concat: 19855, Difference: 3593, Winner: BUILDER
  246. Length: 2, Count: 5, Iterations: 1000000, Builder: 138645, Concat: 180751, Difference: 42106, Winner: BUILDER
  247.  
  248. Length: 2, Count: 6, Iterations: 10, Builder: 2, Concat: 2, Difference: 0, Winner: TIED!
  249. Length: 2, Count: 6, Iterations: 100, Builder: 14, Concat: 21, Difference: 7, Winner: BUILDER
  250. Length: 2, Count: 6, Iterations: 1000, Builder: 152, Concat: 203, Difference: 51, Winner: BUILDER
  251. Length: 2, Count: 6, Iterations: 10000, Builder: 1672, Concat: 2040, Difference: 368, Winner: BUILDER
  252. Length: 2, Count: 6, Iterations: 100000, Builder: 15633, Concat: 21242, Difference: 5609, Winner: BUILDER
  253. Length: 2, Count: 6, Iterations: 1000000, Builder: 154377, Concat: 208434, Difference: 54057, Winner: BUILDER
  254.  
  255. Length: 2, Count: 7, Iterations: 10, Builder: 2, Concat: 3, Difference: 1, Winner: BUILDER
  256. Length: 2, Count: 7, Iterations: 100, Builder: 18, Concat: 24, Difference: 6, Winner: BUILDER
  257. Length: 2, Count: 7, Iterations: 1000, Builder: 170, Concat: 228, Difference: 58, Winner: BUILDER
  258. Length: 2, Count: 7, Iterations: 10000, Builder: 1694, Concat: 2385, Difference: 691, Winner: BUILDER
  259. Length: 2, Count: 7, Iterations: 100000, Builder: 17547, Concat: 23376, Difference: 5829, Winner: BUILDER
  260. Length: 2, Count: 7, Iterations: 1000000, Builder: 173546, Concat: 234780, Difference: 61234, Winner: BUILDER
  261.  
  262. Length: 2, Count: 8, Iterations: 10, Builder: 2, Concat: 3, Difference: 1, Winner: BUILDER
  263. Length: 2, Count: 8, Iterations: 100, Builder: 19, Concat: 26, Difference: 7, Winner: BUILDER
  264. Length: 2, Count: 8, Iterations: 1000, Builder: 217, Concat: 257, Difference: 40, Winner: BUILDER
  265. Length: 2, Count: 8, Iterations: 10000, Builder: 1868, Concat: 2699, Difference: 831, Winner: BUILDER
  266. Length: 2, Count: 8, Iterations: 100000, Builder: 19205, Concat: 26580, Difference: 7375, Winner: BUILDER
  267. Length: 2, Count: 8, Iterations: 1000000, Builder: 192611, Concat: 263281, Difference: 70670, Winner: BUILDER
  268.  
  269. Length: 4, Count: 2, Iterations: 10, Builder: 1, Concat: 1, Difference: 0, Winner: TIED!
  270. Length: 4, Count: 2, Iterations: 100, Builder: 10, Concat: 5, Difference: 5, Winner: CONCAT
  271. Length: 4, Count: 2, Iterations: 1000, Builder: 82, Concat: 38, Difference: 44, Winner: CONCAT
  272. Length: 4, Count: 2, Iterations: 10000, Builder: 820, Concat: 396, Difference: 424, Winner: CONCAT
  273. Length: 4, Count: 2, Iterations: 100000, Builder: 8512, Concat: 4661, Difference: 3851, Winner: CONCAT
  274. Length: 4, Count: 2, Iterations: 1000000, Builder: 84627, Concat: 40269, Difference: 44358, Winner: CONCAT
  275.  
  276. Length: 4, Count: 3, Iterations: 10, Builder: 1, Concat: 1, Difference: 0, Winner: TIED!
  277. Length: 4, Count: 3, Iterations: 100, Builder: 12, Concat: 5, Difference: 7, Winner: CONCAT
  278. Length: 4, Count: 3, Iterations: 1000, Builder: 114, Concat: 59, Difference: 55, Winner: CONCAT
  279. Length: 4, Count: 3, Iterations: 10000, Builder: 1248, Concat: 556, Difference: 692, Winner: CONCAT
  280. Length: 4, Count: 3, Iterations: 100000, Builder: 11751, Concat: 5155, Difference: 6596, Winner: CONCAT
  281. Length: 4, Count: 3, Iterations: 1000000, Builder: 115501, Concat: 52029, Difference: 63472, Winner: CONCAT
  282.  
  283. Length: 4, Count: 4, Iterations: 10, Builder: 2, Concat: 2, Difference: 0, Winner: TIED!
  284. Length: 4, Count: 4, Iterations: 100, Builder: 13, Concat: 7, Difference: 6, Winner: CONCAT
  285. Length: 4, Count: 4, Iterations: 1000, Builder: 136, Concat: 63, Difference: 73, Winner: CONCAT
  286. Length: 4, Count: 4, Iterations: 10000, Builder: 1478, Concat: 630, Difference: 848, Winner: CONCAT
  287. Length: 4, Count: 4, Iterations: 100000, Builder: 13719, Concat: 6444, Difference: 7275, Winner: CONCAT
  288. Length: 4, Count: 4, Iterations: 1000000, Builder: 138356, Concat: 68343, Difference: 70013, Winner: CONCAT
  289.  
  290. Length: 4, Count: 5, Iterations: 10, Builder: 2, Concat: 10, Difference: 8, Winner: BUILDER
  291. Length: 4, Count: 5, Iterations: 100, Builder: 16, Concat: 17, Difference: 1, Winner: BUILDER
  292. Length: 4, Count: 5, Iterations: 1000, Builder: 160, Concat: 176, Difference: 16, Winner: BUILDER
  293. Length: 4, Count: 5, Iterations: 10000, Builder: 1605, Concat: 1773, Difference: 168, Winner: BUILDER
  294. Length: 4, Count: 5, Iterations: 100000, Builder: 16542, Concat: 18422, Difference: 1880, Winner: BUILDER
  295. Length: 4, Count: 5, Iterations: 1000000, Builder: 164440, Concat: 195274, Difference: 30834, Winner: BUILDER
  296.  
  297. Length: 4, Count: 6, Iterations: 10, Builder: 2, Concat: 3, Difference: 1, Winner: BUILDER
  298. Length: 4, Count: 6, Iterations: 100, Builder: 19, Concat: 21, Difference: 2, Winner: BUILDER
  299. Length: 4, Count: 6, Iterations: 1000, Builder: 182, Concat: 207, Difference: 25, Winner: BUILDER
  300. Length: 4, Count: 6, Iterations: 10000, Builder: 1827, Concat: 2153, Difference: 326, Winner: BUILDER
  301. Length: 4, Count: 6, Iterations: 100000, Builder: 18783, Concat: 21541, Difference: 2758, Winner: BUILDER
  302. Length: 4, Count: 6, Iterations: 1000000, Builder: 187102, Concat: 209980, Difference: 22878, Winner: BUILDER
  303.  
  304. Length: 4, Count: 7, Iterations: 10, Builder: 3, Concat: 2, Difference: 1, Winner: CONCAT
  305. Length: 4, Count: 7, Iterations: 100, Builder: 21, Concat: 23, Difference: 2, Winner: BUILDER
  306. Length: 4, Count: 7, Iterations: 1000, Builder: 211, Concat: 231, Difference: 20, Winner: BUILDER
  307. Length: 4, Count: 7, Iterations: 10000, Builder: 2082, Concat: 2568, Difference: 486, Winner: BUILDER
  308. Length: 4, Count: 7, Iterations: 100000, Builder: 21431, Concat: 23813, Difference: 2382, Winner: BUILDER
  309. Length: 4, Count: 7, Iterations: 1000000, Builder: 212701, Concat: 238074, Difference: 25373, Winner: BUILDER
  310.  
  311. Length: 4, Count: 8, Iterations: 10, Builder: 3, Concat: 3, Difference: 0, Winner: TIED!
  312. Length: 4, Count: 8, Iterations: 100, Builder: 24, Concat: 27, Difference: 3, Winner: BUILDER
  313. Length: 4, Count: 8, Iterations: 1000, Builder: 230, Concat: 260, Difference: 30, Winner: BUILDER
  314. Length: 4, Count: 8, Iterations: 10000, Builder: 2318, Concat: 2726, Difference: 408, Winner: BUILDER
  315. Length: 4, Count: 8, Iterations: 100000, Builder: 23347, Concat: 26636, Difference: 3289, Winner: BUILDER
  316. Length: 4, Count: 8, Iterations: 1000000, Builder: 236262, Concat: 266951, Difference: 30689, Winner: BUILDER
  317.  
  318. Length: 6, Count: 2, Iterations: 10, Builder: 2, Concat: 1, Difference: 1, Winner: CONCAT
  319. Length: 6, Count: 2, Iterations: 100, Builder: 10, Concat: 4, Difference: 6, Winner: CONCAT
  320. Length: 6, Count: 2, Iterations: 1000, Builder: 91, Concat: 40, Difference: 51, Winner: CONCAT
  321. Length: 6, Count: 2, Iterations: 10000, Builder: 914, Concat: 408, Difference: 506, Winner: CONCAT
  322. Length: 6, Count: 2, Iterations: 100000, Builder: 9431, Concat: 4213, Difference: 5218, Winner: CONCAT
  323. Length: 6, Count: 2, Iterations: 1000000, Builder: 93085, Concat: 45152, Difference: 47933, Winner: CONCAT
  324.  
  325. Length: 6, Count: 3, Iterations: 10, Builder: 2, Concat: 2, Difference: 0, Winner: TIED!
  326. Length: 6, Count: 3, Iterations: 100, Builder: 12, Concat: 5, Difference: 7, Winner: CONCAT
  327. Length: 6, Count: 3, Iterations: 1000, Builder: 117, Concat: 54, Difference: 63, Winner: CONCAT
  328. Length: 6, Count: 3, Iterations: 10000, Builder: 1166, Concat: 652, Difference: 514, Winner: CONCAT
  329. Length: 6, Count: 3, Iterations: 100000, Builder: 12036, Concat: 5607, Difference: 6429, Winner: CONCAT
  330. Length: 6, Count: 3, Iterations: 1000000, Builder: 119711, Concat: 55821, Difference: 63890, Winner: CONCAT
  331.  
  332. Length: 6, Count: 4, Iterations: 10, Builder: 2, Concat: 2, Difference: 0, Winner: TIED!
  333. Length: 6, Count: 4, Iterations: 100, Builder: 15, Concat: 7, Difference: 8, Winner: CONCAT
  334. Length: 6, Count: 4, Iterations: 1000, Builder: 139, Concat: 69, Difference: 70, Winner: CONCAT
  335. Length: 6, Count: 4, Iterations: 10000, Builder: 1496, Concat: 686, Difference: 810, Winner: CONCAT
  336. Length: 6, Count: 4, Iterations: 100000, Builder: 14356, Concat: 7433, Difference: 6923, Winner: CONCAT
  337. Length: 6, Count: 4, Iterations: 1000000, Builder: 142284, Concat: 71893, Difference: 70391, Winner: CONCAT
  338.  
  339. Length: 6, Count: 5, Iterations: 10, Builder: 3, Concat: 3, Difference: 0, Winner: TIED!
  340. Length: 6, Count: 5, Iterations: 100, Builder: 18, Concat: 21, Difference: 3, Winner: BUILDER
  341. Length: 6, Count: 5, Iterations: 1000, Builder: 163, Concat: 179, Difference: 16, Winner: BUILDER
  342. Length: 6, Count: 5, Iterations: 10000, Builder: 1669, Concat: 1924, Difference: 255, Winner: BUILDER
  343. Length: 6, Count: 5, Iterations: 100000, Builder: 16848, Concat: 19117, Difference: 2269, Winner: BUILDER
  344. Length: 6, Count: 5, Iterations: 1000000, Builder: 169657, Concat: 185814, Difference: 16157, Winner: BUILDER
  345.  
  346. Length: 6, Count: 6, Iterations: 10, Builder: 3, Concat: 3, Difference: 0, Winner: TIED!
  347. Length: 6, Count: 6, Iterations: 100, Builder: 20, Concat: 21, Difference: 1, Winner: BUILDER
  348. Length: 6, Count: 6, Iterations: 1000, Builder: 305, Concat: 272, Difference: 33, Winner: CONCAT
  349. Length: 6, Count: 6, Iterations: 10000, Builder: 1913, Concat: 2225, Difference: 312, Winner: BUILDER
  350. Length: 6, Count: 6, Iterations: 100000, Builder: 19335, Concat: 21731, Difference: 2396, Winner: BUILDER
  351. Length: 6, Count: 6, Iterations: 1000000, Builder: 210172, Concat: 222266, Difference: 12094, Winner: BUILDER
  352.  
  353. Length: 6, Count: 7, Iterations: 10, Builder: 4, Concat: 4, Difference: 0, Winner: TIED!
  354. Length: 6, Count: 7, Iterations: 100, Builder: 30, Concat: 38, Difference: 8, Winner: BUILDER
  355. Length: 6, Count: 7, Iterations: 1000, Builder: 299, Concat: 363, Difference: 64, Winner: BUILDER
  356. Length: 6, Count: 7, Iterations: 10000, Builder: 2424, Concat: 2634, Difference: 210, Winner: BUILDER
  357. Length: 6, Count: 7, Iterations: 100000, Builder: 24085, Concat: 25847, Difference: 1762, Winner: BUILDER
  358. Length: 6, Count: 7, Iterations: 1000000, Builder: 235028, Concat: 248609, Difference: 13581, Winner: BUILDER
  359.  
  360. Length: 6, Count: 8, Iterations: 10, Builder: 7, Concat: 4, Difference: 3, Winner: CONCAT
  361. Length: 6, Count: 8, Iterations: 100, Builder: 33, Concat: 27, Difference: 6, Winner: CONCAT
  362. Length: 6, Count: 8, Iterations: 1000, Builder: 238, Concat: 382, Difference: 144, Winner: BUILDER
  363. Length: 6, Count: 8, Iterations: 10000, Builder: 2436, Concat: 2876, Difference: 440, Winner: BUILDER
  364. Length: 6, Count: 8, Iterations: 100000, Builder: 24650, Concat: 27726, Difference: 3076, Winner: BUILDER
  365. Length: 6, Count: 8, Iterations: 1000000, Builder: 244964, Concat: 272667, Difference: 27703, Winner: BUILDER
  366.  
  367. Length: 8, Count: 2, Iterations: 10, Builder: 3, Concat: 1, Difference: 2, Winner: CONCAT
  368. Length: 8, Count: 2, Iterations: 100, Builder: 9, Concat: 4, Difference: 5, Winner: CONCAT
  369. Length: 8, Count: 2, Iterations: 1000, Builder: 93, Concat: 44, Difference: 49, Winner: CONCAT
  370. Length: 8, Count: 2, Iterations: 10000, Builder: 922, Concat: 413, Difference: 509, Winner: CONCAT
  371. Length: 8, Count: 2, Iterations: 100000, Builder: 9632, Concat: 4416, Difference: 5216, Winner: CONCAT
  372. Length: 8, Count: 2, Iterations: 1000000, Builder: 94767, Concat: 42741, Difference: 52026, Winner: CONCAT
  373.  
  374. Length: 8, Count: 3, Iterations: 10, Builder: 2, Concat: 2, Difference: 0, Winner: TIED!
  375. Length: 8, Count: 3, Iterations: 100, Builder: 12, Concat: 6, Difference: 6, Winner: CONCAT
  376. Length: 8, Count: 3, Iterations: 1000, Builder: 122, Concat: 56, Difference: 66, Winner: CONCAT
  377. Length: 8, Count: 3, Iterations: 10000, Builder: 1210, Concat: 707, Difference: 503, Winner: CONCAT
  378. Length: 8, Count: 3, Iterations: 100000, Builder: 12162, Concat: 5822, Difference: 6340, Winner: CONCAT
  379. Length: 8, Count: 3, Iterations: 1000000, Builder: 121889, Concat: 58291, Difference: 63598, Winner: CONCAT
  380.  
  381. Length: 8, Count: 4, Iterations: 10, Builder: 3, Concat: 2, Difference: 1, Winner: CONCAT
  382. Length: 8, Count: 4, Iterations: 100, Builder: 14, Concat: 7, Difference: 7, Winner: CONCAT
  383. Length: 8, Count: 4, Iterations: 1000, Builder: 246, Concat: 71, Difference: 175, Winner: CONCAT
  384. Length: 8, Count: 4, Iterations: 10000, Builder: 2047, Concat: 714, Difference: 1333, Winner: CONCAT
  385. Length: 8, Count: 4, Iterations: 100000, Builder: 15247, Concat: 7612, Difference: 7635, Winner: CONCAT
  386. Length: 8, Count: 4, Iterations: 1000000, Builder: 150806, Concat: 74352, Difference: 76454, Winner: CONCAT
  387.  
  388. Length: 8, Count: 5, Iterations: 10, Builder: 2, Concat: 8, Difference: 6, Winner: BUILDER
  389. Length: 8, Count: 5, Iterations: 100, Builder: 17, Concat: 19, Difference: 2, Winner: BUILDER
  390. Length: 8, Count: 5, Iterations: 1000, Builder: 173, Concat: 186, Difference: 13, Winner: BUILDER
  391. Length: 8, Count: 5, Iterations: 10000, Builder: 1835, Concat: 1871, Difference: 36, Winner: BUILDER
  392. Length: 8, Count: 5, Iterations: 100000, Builder: 17827, Concat: 19472, Difference: 1645, Winner: BUILDER
  393. Length: 8, Count: 5, Iterations: 1000000, Builder: 177280, Concat: 192707, Difference: 15427, Winner: BUILDER
  394.  
  395. Length: 8, Count: 6, Iterations: 10, Builder: 3, Concat: 3, Difference: 0, Winner: TIED!
  396. Length: 8, Count: 6, Iterations: 100, Builder: 20, Concat: 22, Difference: 2, Winner: BUILDER
  397. Length: 8, Count: 6, Iterations: 1000, Builder: 200, Concat: 216, Difference: 16, Winner: BUILDER
  398. Length: 8, Count: 6, Iterations: 10000, Builder: 1986, Concat: 2330, Difference: 344, Winner: BUILDER
  399. Length: 8, Count: 6, Iterations: 100000, Builder: 20397, Concat: 22318, Difference: 1921, Winner: BUILDER
  400. Length: 8, Count: 6, Iterations: 1000000, Builder: 220784, Concat: 225054, Difference: 4270, Winner: BUILDER
  401.  
  402. Length: 8, Count: 7, Iterations: 10, Builder: 3, Concat: 3, Difference: 0, Winner: TIED!
  403. Length: 8, Count: 7, Iterations: 100, Builder: 31, Concat: 25, Difference: 6, Winner: CONCAT
  404. Length: 8, Count: 7, Iterations: 1000, Builder: 229, Concat: 246, Difference: 17, Winner: BUILDER
  405. Length: 8, Count: 7, Iterations: 10000, Builder: 2276, Concat: 2731, Difference: 455, Winner: BUILDER
  406. Length: 8, Count: 7, Iterations: 100000, Builder: 23104, Concat: 25981, Difference: 2877, Winner: BUILDER
  407. Length: 8, Count: 7, Iterations: 1000000, Builder: 237553, Concat: 281764, Difference: 44211, Winner: BUILDER
  408.  
  409. Length: 8, Count: 8, Iterations: 10, Builder: 3, Concat: 3, Difference: 0, Winner: TIED!
  410. Length: 8, Count: 8, Iterations: 100, Builder: 26, Concat: 27, Difference: 1, Winner: BUILDER
  411. Length: 8, Count: 8, Iterations: 1000, Builder: 254, Concat: 276, Difference: 22, Winner: BUILDER
  412. Length: 8, Count: 8, Iterations: 10000, Builder: 2985, Concat: 3446, Difference: 461, Winner: BUILDER
  413. Length: 8, Count: 8, Iterations: 100000, Builder: 29021, Concat: 32613, Difference: 3592, Winner: BUILDER
  414. Length: 8, Count: 8, Iterations: 1000000, Builder: 261061, Concat: 287922, Difference: 26861, Winner: BUILDER
  415.  
  416. Builder Win: 83
  417.  Concat Win: 70
  418.        Tied: 15
  419.  
  420. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement