Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate ra_syntax to the new rowan API #1545

Merged
merged 8 commits into from Jul 19, 2019

Conversation

@matklad
Copy link
Collaborator

commented Jul 18, 2019

No description provided.

@matklad matklad force-pushed the rowan branch from fc9154c to ea936ba Jul 18, 2019

@kjeremy

This comment has been minimized.

Copy link
Contributor

commented Jul 18, 2019

This looks a lot cleaner. Can't wait to see the performance numbers.

@matklad matklad force-pushed the rowan branch 2 times, most recently from f001441 to 229726e Jul 18, 2019

@matklad matklad force-pushed the rowan branch from cd2640d to cf93218 Jul 19, 2019

@matklad

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 19, 2019

Perf:

λ ./target/baseline analysis-stats --memory-usage ../chalk/
Database loaded, 140 roots, 152.723928ms
Crates in this dir: 9
Total modules found: 68
Total declarations: 2453
Total functions: 776
Total expressions: 13321
Expressions of unknown type: 2261 (16%)
Expressions of partially unknown type: 1026 (7%)
Analysis: 18.034329804s, 843mb allocated 1061mb resident
    94mb ParseQuery
    84mb MacroArgQuery
    67mb CrateDefMapQuery
    39mb TraitSolveQuery (deps)
    33mb CrateDefMapQuery (deps)
    26mb AstIdMapQuery (deps)
    26mb RawItemsQuery (deps)
    25mb RawItemsWithSourceMapQuery (deps)
    25mb ImplDatumQuery (deps)
    25mb MacroArgQuery (deps)
    24mb ParseMacroQuery (deps)
    24mb MacroExpandQuery (deps)
    19mb RawItemsQuery
    18mb InferQuery (deps)
    14mb ImplsForTraitQuery (deps)
    11mb GenericParamsQuery (deps)
     7mb MacroDefQuery
     6mb AstIdMapQuery
     5mb ImplsInModuleWithSourceMapQuery (deps)
     4mb TypeForDefQuery (deps)
     4mb GenericPredicatesQuery (deps)
     4mb ImplsInModuleQuery
     4mb ImplDatumQuery
  3678kb ImplsInCrateQuery (deps)
  3003kb GenericDefaultsQuery (deps)
  2630kb ImplsForTraitQuery
  2584kb GenericParamsQuery
  2581kb ImplsInModuleQuery (deps)
  2568kb InferQuery
  2178kb ParseQuery (deps)
  1980kb BodyHirQuery
  1932kb RawItemsWithSourceMapQuery
  1373kb BodyWithSourceMapQuery (deps)
  1364kb FnDataQuery (deps)
  1269kb CallableItemSignatureQuery (deps)
  1183kb ParseMacroQuery
  1162kb ModuleLangItemsQuery (deps)
   828kb TypeAliasDataQuery (deps)
   824kb StructDatumQuery (deps)
   742kb BodyHirQuery (deps)
   706kb ImplsInModuleWithSourceMapQuery
   704kb BodyWithSourceMapQuery
   653kb TypeForFieldQuery (deps)
   621kb TypeForDefQuery
   590kb FnDataQuery
   588kb ExprScopesQuery (deps)
   457kb ImplsInCrateQuery
   392kb MacroDefQuery (deps)
   389kb MacroExpandQuery
   381kb GenericPredicatesQuery
   323kb ExprScopesQuery
   264kb TraitDatumQuery (deps)
   218kb StructDatumQuery
   208kb TypeAliasDataQuery
   164kb CallableItemSignatureQuery
   147kb TraitDataQuery (deps)
   129kb GenericDefaultsQuery
   112kb StructDataQuery (deps)
   112kb EnumDataQuery (deps)
   108kb LangItemsQuery (deps)
   103kb TraitItemsIndexQuery (deps)
    98kb EnumDataQuery
    69kb TraitDatumQuery
    30kb StructDataQuery
    28kb LangItemQuery (deps)
    14kb TypeForFieldQuery
    12kb ConstDataQuery (deps)
    11kb TraitDataQuery
     8kb TraitSolveQuery
     7kb TraitItemsIndexQuery
   4096b ModuleLangItemsQuery
      0b SourceRootCratesQuery
      0b SourceRootCratesQuery (deps)
      0b ConstDataQuery
      0b StaticDataQuery
      0b StaticDataQuery (deps)
      0b LangItemsQuery
      0b LangItemQuery
      0b DocumentationQuery
      0b DocumentationQuery (deps)
      0b AssociatedTyDataQuery
      0b AssociatedTyDataQuery (deps)
leftover: 206mb

13:45:27|~/projects/rust-analyzer|rowan⚡*
λ ./target/new-rowan analysis-stats --memory-usage ../chalk/
Database loaded, 140 roots, 149.776766ms
Crates in this dir: 9
Total modules found: 68
Total declarations: 2453
Total functions: 776
Total expressions: 13321
Expressions of unknown type: 2261 (16%)
Expressions of partially unknown type: 1026 (7%)
Analysis: 18.824071974s, 774mb allocated 953mb resident
    85mb MacroArgQuery
    68mb CrateDefMapQuery
    40mb TraitSolveQuery (deps)
    32mb CrateDefMapQuery (deps)
    30mb ParseQuery
    26mb AstIdMapQuery (deps)
    26mb RawItemsQuery (deps)
    26mb ImplDatumQuery (deps)
    25mb RawItemsWithSourceMapQuery (deps)
    24mb MacroArgQuery (deps)
    24mb ParseMacroQuery (deps)
    24mb MacroExpandQuery (deps)
    19mb RawItemsQuery
    18mb InferQuery (deps)
    14mb ImplsForTraitQuery (deps)
    11mb GenericParamsQuery (deps)
     7mb MacroDefQuery
     6mb AstIdMapQuery
     5mb ImplsInModuleWithSourceMapQuery (deps)
     4mb TypeForDefQuery (deps)
     4mb GenericPredicatesQuery (deps)
     4mb ImplDatumQuery
     4mb ImplsInModuleQuery
  3708kb ImplsInCrateQuery (deps)
  3372kb ImplsForTraitQuery
  2964kb GenericDefaultsQuery (deps)
  2624kb GenericParamsQuery
  2621kb ImplsInModuleQuery (deps)
  2582kb InferQuery
  2105kb BodyHirQuery
  2030kb ParseQuery (deps)
  1925kb RawItemsWithSourceMapQuery
  1384kb BodyWithSourceMapQuery (deps)
  1369kb FnDataQuery (deps)
  1202kb CallableItemSignatureQuery (deps)
  1170kb ModuleLangItemsQuery (deps)
  1040kb StructDatumQuery (deps)
   864kb TypeAliasDataQuery (deps)
   728kb BodyHirQuery (deps)
   714kb BodyWithSourceMapQuery
   674kb TypeForFieldQuery (deps)
   627kb ExprScopesQuery (deps)
   585kb FnDataQuery
   526kb ParseMacroQuery
   446kb GenericPredicatesQuery
   380kb MacroExpandQuery
   331kb ExprScopesQuery
   321kb MacroDefQuery (deps)
   284kb ImplsInModuleWithSourceMapQuery
   263kb TypeForDefQuery
   252kb TraitDatumQuery (deps)
   248kb StructDatumQuery
   231kb TypeForFieldQuery
   173kb TypeAliasDataQuery
   165kb ImplsInCrateQuery
   147kb TraitDataQuery (deps)
   135kb CallableItemSignatureQuery
   127kb GenericDefaultsQuery
   115kb TraitItemsIndexQuery (deps)
   112kb StructDataQuery (deps)
   112kb EnumDataQuery (deps)
   102kb EnumDataQuery
    96kb LangItemsQuery (deps)
    83kb TraitDatumQuery
    28kb StructDataQuery
    28kb LangItemQuery (deps)
    12kb AssociatedTyDataQuery (deps)
    11kb TraitItemsIndexQuery
     8kb TraitSolveQuery
     4kb ConstDataQuery
   4096b ModuleLangItemsQuery
   4096b LangItemsQuery
   3072b TraitDataQuery
      0b SourceRootCratesQuery
      0b SourceRootCratesQuery (deps)
      0b ConstDataQuery (deps)
      0b StaticDataQuery
      0b StaticDataQuery (deps)
      0b LangItemQuery
      0b DocumentationQuery
      0b DocumentationQuery (deps)
      0b AssociatedTyDataQuery
leftover: 198mb

13:45:52|~/projects/rust-analyzer|rowan⚡*
λ 

Note that syntax trees themselves went from 94mb to 30mb, which is a huge win. The overall win is less impressive though, because now we have more memory hot-spots, which should be fixed one by one

@matklad matklad referenced this pull request Jul 19, 2019
@matklad

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 19, 2019

bors r+

bors bot added a commit that referenced this pull request Jul 19, 2019

Merge #1545
1545: migrate ra_syntax to the new rowan API r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>

@matklad matklad marked this pull request as ready for review Jul 19, 2019

@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 19, 2019

@bors bors bot merged commit d4a6616 into master Jul 19, 2019

2 checks passed

bors Build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@bors bors bot deleted the rowan branch Jul 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.