Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

Source code checked in, #74e24d3464c95f1557ce06528588da9b5540955d

$
0
0
Analysis domains & misc perf improvements Adds a visibility filter to analysis. Each write is now always associated with a specific defining module. Previously writes would be associated with either the declaring or defining module. To support this we now have AnalysisValue's wrapped in Proxy's which get nulled out when a new version of a ProjectEntry is defined. This ensures that older versions get evicted and freed (and presumably faster than before). When a proxy is no longer alive it no longer propagates through our various HashSet's and the small stubs will eventually disappear from the system. To support that we gain a new AnalysisHashSet class which can easily ignore the values (and also fixes the same thread safety issue that our AnalysisDictionary class fixed) Visibility is then calculcated using a simple lookup into a set. When a module gets added to the tree we update the related modules with visibility info. Currently we have 2 rules which define visibility: My peers can see my assignments/I can see my peers assignments My parent and its peers can see my assignments A modules peers are the collection of modules from the closest upper node_modules folder and terminating at any other node_modules folders below that. Along w/ this there's some simplifications to IAnalysisSet removing overloads which pass the canMutate flag. Now we assume all calls can mutate our mutable HashSet's because just about all of those calls are gone. SetEquals is also removed in favor of just constructing new HashSet's because it's only used in Debug code. We also lose some implementations. AnalysisSetManyObject/AnalysisSetManyUnion have become merged and are just our AnalysisHashSet now. Also splits up VariableDef into TypedDef base class and VariableDef. TypedDef's store types and dependencies, VariableDef's can have references and assignments. Changes EstimateTypeCount -> CheckTypeCount which can avoid allocating Changes the inner loop of fetching types from an AnalysisDictionary to be allocation free as this is the inner most loop of the entire analysis engine Some results of perf deltas: Try-Ghost: 592419 ms 7607 files 1152 MB working set, 974 MB GC Mem, 493 (11090) completions BASE: 1147401 ms 7607 files 1156 MB working set, 1109 MB GC Mem, 447 (16876) completions DIFF: -554982 ms 0 files -4 MB working set, -135 MB GC Mem, 46 (-5786) completions Express: 528 (was 1788 -238.%) Grunt: 11689 (was 25732 -120.%) Mongoose: 8644 (was 10018 -15.8%) Bluebird: 2212 (was 2555 -15.5%) Less: 15639 (was 18644 -19.2%) Running larger combinations we see bigger gains – for example in one case running w/ 40 modules we go from 2148999ms to 285360ms. We can also now analyze 99 of the top 100 modules together (previously we'd OOM) 1121903 ms 11882 files 1571 MB working set, 1386 MB GC Mem, 3188 (52126) completions

Viewing all articles
Browse latest Browse all 4630

Trending Articles