Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.4.9

## Performance

- perf(sandbox): make `Cache.SandboxRegistry.register_caches/2` post-register sleep configurable via `Cache.Config.sandbox_sleep_ms/0` (`config :elixir_cache, :sandbox_sleep_ms, 50`). Default is unchanged (50 ms). Test suites that don't need the sleep can set it to `0` in `config/test.exs` to save ~50 ms per cache registered per test — material on apps with many cache modules.

# 0.4.8

## Bug Fixes
Expand Down
9 changes: 9 additions & 0 deletions lib/cache/config.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
defmodule Cache.Config do
@moduledoc false

@app :elixir_cache

def sandbox_sleep_ms do
Application.get_env(@app, :sandbox_sleep_ms, 50)
end
end
3 changes: 1 addition & 2 deletions lib/cache/sandbox_registry.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ defmodule Cache.SandboxRegistry do
More details soon...
"""

@sleep_for_sync 50
@registry :elixir_cache_sandbox
@keys :duplicate

Expand Down Expand Up @@ -38,7 +37,7 @@ defmodule Cache.SandboxRegistry do
{:error, :registry_not_started} -> raise_not_started!()
end

Process.sleep(@sleep_for_sync)
Process.sleep(Cache.Config.sandbox_sleep_ms())

res
end
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule ElixirCache.MixProject do
def project do
[
app: :elixir_cache,
version: "0.4.8",
version: "0.4.9",
elixir: "~> 1.11",
start_permanent: Mix.env() == :prod,
description:
Expand Down
Loading