-
Notifications
You must be signed in to change notification settings - Fork 1
/
try_me.exs
40 lines (28 loc) · 1.32 KB
/
try_me.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
path_to_file = Path.absname("./files/large.txt")
path_to_dir = Path.absname("./files/parts_large")
# ------- Eager -------
# IO.puts("Eager - Map")
# Timer.run(Eager, :process_file_map, [path_to_file]) |> IO.inspect()
# IO.puts("\nEager - Ets")
# Timer.run(Eager, :process_file_ets, [path_to_file]) |> IO.inspect()
# ------- Lazy -------
IO.puts("\nLazy")
Timer.run(Lazy, :process_file_map, [path_to_file]) |> IO.inspect()
IO.puts("\nLazy - Ets")
Timer.run(Lazy, :process_file_ets, [path_to_file]) |> IO.inspect()
# ------- Flow Maps -------
IO.puts("\nFlow - single source - Maps")
Timer.run(Flow, :process_file_map, [path_to_file]) |> IO.inspect()
IO.puts("\nFlow - multiple sources - Maps")
Timer.run(Flow, :process_dir_map, [path_to_dir]) |> IO.inspect()
# ------- Flow ETS -------
IO.puts("\nFlow - single source - ETS")
Timer.run(Flow, :process_file_ets, [path_to_file]) |> IO.inspect()
IO.puts("\nFlow - multiple sources - ETS")
Timer.run(Flow, :process_dir_ets, [path_to_dir]) |> IO.inspect()
# ------- Flow - Windows/Triggers -------
# IO.puts("\nFlow - global window - count trigger - keep reducer accumulator")
# Flow.Window.Trigger.global(1..1000, 100, :keep) |> IO.inspect()
#
# IO.puts("\nFlow - global window - count trigger - reset reducer accumulator")
# Flow.Window.Trigger.global(1..1000, 100, :reset) |> IO.inspect()