probcomp / GenExperimental.jl

Featherweight embedded probabilistic programming language and compositional inference programming library
MIT License
17 stars 2 forks source link

Parametrize address type in ProgramTrace #72

Open marcoct opened 6 years ago

marcoct commented 6 years ago

Making ProgramTrace parametric on the address type (e.g. ProgramTrace{AddressType}) may be a useful performance optimization in the future, because using the Any type for the address, as currently done, probably requires a run-time lookup of the hash function for every operation on the underlying Dict.

All of the example programs we have written for demos so far use String address types. The ability to have other address types (like Int) for ProgramTrace may become useful when using automated addressing as in e.g. https://github.com/probcomp/Gen.jl/issues/61