Replace visited list for pass_common with hash_set (which isn't complete, but has the basics) for a massive speedup (6xish)

This commit is contained in:
Nathan Braswell
2017-01-22 10:13:06 -05:00
parent 896e8a936c
commit ebb34d5ba3
8 changed files with 74 additions and 71 deletions

View File

@@ -22,7 +22,7 @@ fun node_counter_test(name_ast_map: *map<string, pair<*tree<symbol>,*ast_node>>,
}
fun node_counter_helper(name_ast_map: *map<string, pair<*tree<symbol>,*ast_node>>, ast_to_syntax: *map<*ast_node, *tree<symbol>>): int {
var counter = 0
var visited = set<*ast_node>()
var visited = hash_set<*ast_node>()
name_ast_map->for_each(fun(name: string, syntax_ast_pair: pair<*tree<symbol>,*ast_node>) {
var helper = fun(node: *ast_node, parent_chain: *stack<*ast_node>) {
counter++