Skip to content

runtime: interactive-mode fingerprint re-check is ~half the remaining cost of Lua.new/1 #415

Description

@davydog187

Found during automated review of PR #398.

With the template memoized, the md5 fingerprint staleness re-check in Lua.VM.Bootstrap costs ~0.23 µs of the ~0.44 µs Lua.new() (52%) — and it is paid on every call in :interactive code mode, which includes deployments that never reload code (mix phx.server in a container, escripts, mix run --no-halt). Only mix release (embedded mode) skips it.

Consider gating the re-check on something stronger than :code.get_mode() — e.g. a compile-time Application.compile_env switch defaulting to dev/test-only — so production non-release deployments get the full fast path. Needs care not to break the iex live-reload story the check exists for.

🤖 Filed from an automated review pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions