Skip to content

Store global variables in a const structure #30

Description

@dpsanders

Using global variables as in

global steps = 200 # discretization levels of probability

is a performance trap.

To fix this, I suggest grouping all the global variables into a mutable struct, which you refer to via a const global. See e.g.

https://github.com/JuliaIntervals/IntervalArithmetic.jl/blob/db9202ccd08402d05616442f395e88cb21f79b9b/src/intervals/precision.jl

for a similar design.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions