I'm new to this package, but I hit some performance bottleneck due to type instability. Particularly, RuleNode is not typed, so does get_executable (e.g.
|
root = (rulenode._val != nothing) ? |
). As a result, programs that evaluate the tree under a grammar are not typed and tends to have performance issues.
By looking at
|
mutable struct RuleNode |
|
ind::Int # index in grammar |
|
_val::Any #value of _() evals |
|
children::Vector{RuleNode} |
|
end |
, it seems to me that it should be possible to correctly type
RuleNode because we can know the type of
_val from a grammar - if a grammar is specificed. This is actually done in the the codes below the struct definition.
Does it make sense to support such things, either in RuleNode or another new struct (e.g. TypedRuleNode?
I'm new to this package, but I hit some performance bottleneck due to type instability. Particularly,
RuleNodeis not typed, so doesget_executable(e.g.ExprRules.jl/src/ExprRules.jl
Line 370 in 6c983e5
By looking at
ExprRules.jl/src/ExprRules.jl
Lines 234 to 238 in 6c983e5
RuleNodebecause we can know the type of_valfrom a grammar - if a grammar is specificed. This is actually done in the the codes below the struct definition.Does it make sense to support such things, either in
RuleNodeor another new struct (e.g.TypedRuleNode?