Skip to content

Poor performance on Lokathor/gl46 #5392

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

Open
lnicola opened this issue Jul 15, 2020 · 7 comments
Open

Poor performance on Lokathor/gl46 #5392

lnicola opened this issue Jul 15, 2020 · 7 comments
Labels
A-perf performance issues C-enhancement Category: enhancement E-unknown It's unclear if the issue is E-hard or E-easy without digging in S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@lnicola
Copy link
Member

lnicola commented Jul 15, 2020

https://github.com./Lokathor/gl46/

@lnicola
Copy link
Member Author

lnicola commented Jul 15, 2020

Hover:

  128ms - handle_hover
      127ms - Semantics::analyze2
            0ms - crate_def_map:wait (2 calls)
            0ms - infer:wait (1 calls)
            0ms - module_to_def (1 calls)
          127ms - ???
        0ms - classify_name_ref (1 calls)
        0ms - crate_def_map:wait (7 calls)

Enhanced Enter:

  209ms - handle_folding_range
  229ms - handle_document_symbol
 1109ms - handle_code_lens
      267ms - SourceBinder::to_module_def
          267ms - crate_def_map:wait
              192ms - item_tree_query @ HirFileId(FileId(FileId(0)))
               75ms - ???
        0ms - SourceBinder::to_module_def (36 calls)
        4ms - crate_def_map:wait (19910 calls)
        0ms - impl_data_query (3 calls)
       11ms - module_to_def (7946 calls)
      826ms - ???
 2265ms - publish_diagnostics
     2260ms - diagnostics
          161ms - SourceBinder::to_module_def
              161ms - crate_def_map:wait
         1746ms - Module::diagnostics
               12ms - Function::diagnostics
                   12ms - infer:wait @ report_error_as_necessary_from
                       12ms - body_with_source_map_query
                            0ms - crate_def_map:wait (180 calls)
                            0ms - item_tree_query (88 calls)
                            9ms - parse_macro_query (104 calls)
               30ms - Function::diagnostics
                    0ms - infer:wait (1 calls)
                   30ms - ???
              975ms - Module::diagnostics
                   15ms - Function::diagnostics
                       14ms - infer:wait @ load_global_gl_with
                            8ms - body_with_source_map_query (1 calls)
                  959ms - Function::diagnostics (1983 calls)
                    0ms - crate_def_map:wait (3 calls)
              725ms - Module::diagnostics
                  724ms - Function::diagnostics (1986 calls)
                    0ms - crate_def_map:wait (3 calls)
                1ms - Function::diagnostics (16 calls)
                0ms - Module::diagnostics (2 calls)
                0ms - crate_def_map:wait (3 calls)
          352ms - ???
 2268ms - handle_inlay_hints
     2260ms - inlay_hints
          210ms - Semantics::analyze2
              206ms - SourceBinder::to_module_def
                  206ms - crate_def_map:wait
                0ms - body_with_source_map_query (1 calls)
                0ms - crate_def_map:wait (2 calls)
                3ms - infer:wait (1 calls)
           15ms - Semantics::analyze2
                0ms - SourceBinder::to_module_def (1 calls)
                1ms - body_with_source_map_query (1 calls)
                0ms - crate_def_map:wait (1 calls)
                0ms - infer:wait (1 calls)
               14ms - ???
          216ms - Semantics::analyze2
                0ms - crate_def_map:wait (2 calls)
                0ms - infer:wait (1 calls)
                0ms - module_to_def (1 calls)
              216ms - ???
           70ms - Semantics::analyze2
                0ms - crate_def_map:wait (2 calls)
                0ms - infer:wait (1 calls)
                0ms - module_to_def (1 calls)
               70ms - ???
          898ms - Semantics::analyze2 (34114 calls)
            0ms - crate_def_map:wait (3984 calls)
          848ms - ???

@matklad
Copy link
Member

matklad commented Jul 15, 2020

90% sure that we hit "resloving sytnax PTR is O(N)", cc @CAD97, this might be an interesting test case.

@matklad matklad added the E-unknown It's unclear if the issue is E-hard or E-easy without digging in label Jul 15, 2020
@lnicola lnicola added the S-unactionable Issue requires feedback, design decisions or is blocked on other work label Oct 15, 2020
@lnicola
Copy link
Member Author

lnicola commented Feb 22, 2021

Triage: we're still slow. The diagnostics seem to take about 800 ms in struct_loader, inlay hints take 500 ms.

@Lokathor
Copy link

I recently put out a 0.2 version of this crate and my anecdotal experience is that RA seems to be doing reasonably while I'm making a project using it. Sluggish, but largely tolerable.

@matklad
Copy link
Member

matklad commented Feb 22, 2021

30% sure its #6466

@Lokathor
Copy link

Wasn't that PR merged in november though?

@flodiebold
Copy link
Member

No, it was closed without being merged.

@Veykril Veykril added the A-perf performance issues label Nov 11, 2022
@Veykril Veykril added the C-enhancement Category: enhancement label Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-perf performance issues C-enhancement Category: enhancement E-unknown It's unclear if the issue is E-hard or E-easy without digging in S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

5 participants