View difference between Paste ID: wV6HUw93 and ZCcceqHu
SHOW: | | - or go back to the newest paste.
1
(* 2.257s *)
2
let () =
3
  let a = ref "asd" in
4
  let b = "qwe" in
5
  for i = 0 to 100000 do
6
    a := String.concat "" [!a; b]
7
  done
8
9-
(* 2.002s, without conversion to string: 0.002s *)
9+
(* 2.002s; without conversion to string: 0.002s *)
10
let () =
11
  let buffer = Buffer.create 100 in
12
  Buffer.add_string buffer "asd";
13
  for i = 0 to 100000 do
14
    Buffer.add_string buffer "qwe";
15
    ignore (Buffer.contents buffer);
16
  done;