This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Benchfella.start duration: 1.0#, format: :machine | |
defmodule StringDuplicateBench do | |
use Benchfella | |
@iterations [100, 1000, 10000, 100000] | |
Enum.each(@iterations, fn n -> | |
@str "1234567890" | |
@n n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Stemmer do | |
def stem(word) do | |
IO.puts "stemming #{word}" | |
case Regex.run(~r/^(.+?)(ASD|QWE)$/u, word) do | |
[pattern_matching, like, "ASD"] -> IO.inspect like | |
[pattern_matching, like, "QWE"] -> IO.puts "whatever" | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Mix.TasksServer do | |
@moduledoc false | |
use GenServer.Behaviour | |
def start_link() do | |
:gen_server.start_link({ :local, __MODULE__ }, __MODULE__, :ok, []) | |
end | |
def clear_tasks() do | |
call :clear_tasks |
NewerOlder