Skip to content

Commit e24d0e6

Browse files
authored
Performance: make SyntaxGraph and SyntaxList mutable (#12)
The long initial hang in generating code for JuliaLowering is LLVM taking forever to deal with what julia gives it. Large structs on the stack are the likely culprit.
1 parent f6bfc35 commit e24d0e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/syntax_graph.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ one or several syntax trees.
66
77
TODO: Global attributes!
88
"""
9-
struct SyntaxGraph{Attrs}
9+
mutable struct SyntaxGraph{Attrs}
1010
edge_ranges::Vector{UnitRange{Int}}
1111
edges::Vector{NodeId}
1212
attributes::Attrs
@@ -632,7 +632,7 @@ end
632632

633633
#-------------------------------------------------------------------------------
634634
# Lightweight vector of nodes ids with associated pointer to graph stored separately.
635-
struct SyntaxList{GraphType, NodeIdVecType} <: AbstractVector{SyntaxTree}
635+
mutable struct SyntaxList{GraphType, NodeIdVecType} <: AbstractVector{SyntaxTree}
636636
graph::GraphType
637637
ids::NodeIdVecType
638638
end

0 commit comments

Comments
 (0)