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

Feature: autogenerate profiling code for packer_compiled #221

Merged
merged 17 commits into from
Apr 19, 2021

Conversation

wbthomason
Copy link
Owner

@wbthomason wbthomason commented Feb 16, 2021

This PR adds timing code wrapping each "chunk" of the compiled output, which runs iff the environment variable PACKER_PROFILE is present and true. This allows a simple output of timing information for each part of the compiled loaders.

This is still WIP. The main things it needs are:

  • Define the timed_chunk function, which is simple except for figuring out what name to use for each chunk
  • Improve output formatting
  • Add line numbers to output
  • Sort output by time
  • [ ] Concatenate output to compiled file
  • Maybe add output only for chunks over some threshold of time?

Pinging @akinsho re: discussion on #191.

@wbthomason wbthomason marked this pull request as draft February 16, 2021 19:28
@wbthomason wbthomason added this to In progress in WIP features via automation Feb 16, 2021
@akinsho
Copy link
Collaborator

akinsho commented Feb 16, 2021

🙌🏿 this looks great @wbthomason, regarding some of the todos:

  • For the name of the chunk could you could use the identifier of the thing being timed I guess they don't all have clear identifiers 🤔
  • regarding formatting the table plenary.profile creates is fairly tidy but maybe is overkill here could be simpler to start like.
string.format('Chunk name: %s -------- Time in ms %d ----------- metadata %s)
  • The threshold could come now or later depending on complexity but I guess if it was specified in the config, maybe within a sub table called profile 🤷🏿 then you could just skip those in the calc

@akinsho
Copy link
Collaborator

akinsho commented Mar 29, 2021

@wbthomason just revisited this today since I'm seeing a lot of slowness in my config I use plenary's profile module to check

 > TOTAL TIME   = 0.215474 s

-------------------------------------------------------------------------------------------------------------------------------------
| FILE                                                                       : FUNCTION              : LINE  : TIME   : %     : #   |
-------------------------------------------------------------------------------------------------------------------------------------
| [string ":lua"]                                                            : try_loadstring        :   12  : 0.1784 : 82.8  :  38 |
| [string "..."]                                                             : Anon                  :    0  : 0.1779 : 82.5  :  38 |
| /Users/akinso/.config/nvim/lua/as/plugins/lspconfig                        : setup_servers         :  226  : 0.0695 : 32.2  :   1 |
| vim                                                                        : Anon                  :  122  : 0.0613 : 28.5  : 183 |
| vim/shared                                                                 : tbl_extend            :  203  : 0.0570 : 26.5  : 742 |
| vim/shared                                                                 : tbl_deep_extend       :  203  : 0.0491 : 22.8  :  16 |
| ...cker/start/telescope.nvim/lua/telescope/builtin/init                    : Anon                  :    0  : 0.0373 : 17.3  :   1 |
| vim/shared                                                                 : validate              :  558  : 0.0293 : 13.6  : 1806|
| vim/shared                                                                 : is_valid              :  516  : 0.0238 : 11.0  : 1806|
| ...r/start/telescope.nvim/lua/telescope/previewers/init                    : Anon                  :    0  : 0.0222 : 10.3  :   1 |
| .../site/pack/packer/opt/nvim-lspinstall/lua/lspinstall                    : Anon                  :    0  : 0.0138 : 6.4   :   1 |
| ...ck/packer/opt/nvim-lspinstall/lua/lspinstall/servers                    : Anon                  :    0  : 0.0137 : 6.3   :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/configs                    : setup                 :  273  : 0.0122 : 5.7   :   1 |
| ...scope.nvim/lua/telescope/previewers/buffer_previewer                    : Anon                  :    0  : 0.0118 : 5.5   :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/install                    : ensure_installed      :  278  : 0.0116 : 5.4   :   1 |
| ...ite/pack/packer/start/lsp-status.nvim/lua/lsp-status                    : Anon                  :    0  : 0.0111 : 5.2   :   1 |
| .../pack/packer/start/plenary.nvim/lua/plenary/filetype                    : Anon                  :    0  : 0.0106 : 4.9   :   1 |
| ...im/site/pack/packer/opt/nvim-lspconfig/lua/lspconfig                    : __index               :   68  : 0.0103 : 4.8   :  26 |
| .../pack/packer/start/plenary.nvim/lua/plenary/filetype                    : add_file              :   39  : 0.0101 : 4.7   :   2 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/install                    : install_lang          :  246  : 0.0097 : 4.5   :  50 |
| ...lescope.nvim/lua/telescope/previewers/term_previewer                    : Anon                  :    0  : 0.0093 : 4.3   :   1 |
| vim/shared                                                                 : tbl_islist            :  358  : 0.0089 : 4.1   : 896 |
| .../site/pack/packer/opt/nvim-lspinstall/lua/lspinstall                    : setup                 :   98  : 0.0087 : 4.1   :   1 |
| ...im/site/pack/packer/start/gitsigns.nvim/lua/gitsigns                    : Anon                  :    0  : 0.0087 : 4.1   :   1 |
| .../start/telescope.nvim/lua/telescope/previewers/utils                    : Anon                  :    0  : 0.0087 : 4.0   :   1 |
| ...ck/packer/start/telescope.nvim/lua/telescope/pickers                    : Anon                  :    0  : 0.0086 : 4.0   :   1 |
| ...acker/start/lsp-status.nvim/lua/lsp-status/messaging                    : Anon                  :    0  : 0.0082 : 3.8   :   1 |
| ...ack/packer/start/nvim-treesitter/lua/nvim-treesitter                    : Anon                  :    0  : 0.0073 : 3.4   :   1 |
| .../pack/packer/start/plenary.nvim/lua/plenary/filetype                    : Anon                  :   13  : 0.0073 : 3.4   :   4 |
| ...neovim/HEAD-8665a96_2/share/nvim/runtime/lua/vim/lsp                    : Anon                  :    0  : 0.0065 : 3.0   :   1 |
| ...cker/start/telescope.nvim/lua/telescope/actions/init                    : Anon                  :    0  : 0.0061 : 2.8   :   1 |
| .../pack/packer/opt/nvim-lspconfig/lua/lspconfig/clangd                    : Anon                  :    0  : 0.0057 : 2.7   :   1 |
| vim/shared                                                                 : _is_type              :  512  : 0.0057 : 2.7   : 1876|
| vim/shared                                                                 : installed_servers     :  165  : 0.0054 : 2.5   :   1 |
| ...pack/packer/start/nvim-bufferline.lua/lua/bufferline                    : setup                 :  908  : 0.0053 : 2.5   :   1 |
| .../site/pack/packer/opt/nvim-lspinstall/lua/lspinstall                    : func                  :   82  : 0.0051 : 2.4   :  25 |
| .../site/pack/packer/opt/nvim-lspinstall/lua/lspinstall                    : is_server_installed   :   82  : 0.0051 : 2.3   :  25 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/install                    : Anon                  :    0  : 0.0044 : 2.0   :   1 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async                    : setup                 :   72  : 0.0043 : 2.0   :   1 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async                    : Anon                  :   52  : 0.0043 : 2.0   :   1 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async                    : step                  :   54  : 0.0043 : 2.0   :   1 |
| ...pack/packer/start/telescope.nvim/lua/telescope/utils                    : Anon                  :    0  : 0.0035 : 1.6   :   1 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : nnoremap              :   90  : 0.0033 : 1.5   :  31 |
| [string ":lua"]                                                            : Anon                  :    0  : 0.0031 : 1.5   :   2 |
| ...AD-8665a96_2/share/nvim/runtime/lua/vim/lsp/protocol                    : make_client_capabiliti:  621  : 0.0030 : 1.4   :   7 |
| ...AD-8665a96_2/share/nvim/runtime/lua/vim/lsp/handlers                    : Anon                  :    0  : 0.0028 : 1.3   :   1 |
| ...pack/packer/opt/nvim-lspconfig/lua/lspconfig/configs                    : __newindex            :    7  : 0.0028 : 1.3   :  26 |
| ...te/pack/packer/start/gitsigns.nvim/lua/gitsigns/diff                    : Anon                  :    0  : 0.0026 : 1.2   :   1 |
| ...pack/packer/start/nvim-bufferline.lua/lua/bufferline                    : merge_preferences     :  897  : 0.0026 : 1.2   :   1 |
| ...pack/packer/start/telescope.nvim/lua/telescope/utils                    : Anon                  :  341  : 0.0026 : 1.2   :   1 |
| ...packer/start/nvim-web-devicons/lua/nvim-web-devicons                    : setup                 :  864  : 0.0026 : 1.2   :   1 |
| .../pack/packer/start/gitsigns.nvim/lua/gitsigns/config                    : process               :  330  : 0.0025 : 1.1   :   1 |
| .../nvim/site/pack/packer/opt/nvim-compe/lua/compe/init                    : Anon                  :    0  : 0.0024 : 1.1   :   1 |
| ...vim/site/pack/packer/start/popup.nvim/lua/popup/init                    : Anon                  :    0  : 0.0023 : 1.1   :   1 |
| .../start/nvim-bufferline.lua/lua/bufferline/highlights                    : set_all               :   52  : 0.0022 : 1.0   :   1 |
| ...eesitter-textobjects/lua/nvim-treesitter-textobjects                    : init                  :   20  : 0.0020 : 0.9   :   1 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : validate_mappings     :   71  : 0.0020 : 0.9   :  50 |
| vim                                                                        : __index               :  287  : 0.0019 : 0.9   :   3 |
| ...ack/packer/start/telescope.nvim/lua/telescope/config                    : set_defaults          :   49  : 0.0018 : 0.8   :   2 |
| ...ite/pack/packer/start/gitsigns.nvim/lua/gitsigns/git                    : Anon                  :    0  : 0.0017 : 0.8   :   1 |
| ...ack/packer/start/telescope.nvim/lua/telescope/config                    : set                   :   56  : 0.0016 : 0.8   :  64 |
| ...acker/start/nvim-treesitter/lua/nvim-treesitter/info                    : Anon                  :    0  : 0.0016 : 0.7   :   1 |
| ...ck/packer/start/telescope.nvim/lua/telescope/finders                    : Anon                  :    0  : 0.0015 : 0.7   :   1 |
| .../start/nvim-bufferline.lua/lua/bufferline/highlights                    : set_one               :   15  : 0.0015 : 0.7   :  26 |
| .../pack/packer/start/telescope.nvim/lua/telescope/init                    : Anon                  :    0  : 0.0013 : 0.6   :   1 |
| ...ack/packer/start/telescope.nvim/lua/telescope/config                    : Anon                  :    0  : 0.0013 : 0.6   :   1 |
| ...cker/start/nvim-treesitter/lua/nvim-treesitter/utils                    : difference            :  147  : 0.0012 : 0.6   :   1 |
| vim/shared                                                                 : tbl_count             :  395  : 0.0012 : 0.5   :  41 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/configs                    : Anon                  :    0  : 0.0011 : 0.5   :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/parsers                    : Anon                  :    0  : 0.0011 : 0.5   :   1 |
| ...cker/start/nvim-treesitter/lua/nvim-treesitter/utils                    : predicate             :  164  : 0.0010 : 0.5   :  50 |
| ...2/share/nvim/runtime/lua/vim/treesitter/languagetree                    : Anon                  :    0  : 0.0010 : 0.5   :   1 |
| vim/shared                                                                 : Anon                  :  203  : 0.0010 : 0.5   :  21 |
| ...site/pack/packer/opt/nvim-compe/lua/compe/completion                    : Anon                  :    0  : 0.0010 : 0.4   :   1 |
| .../site/pack/packer/opt/nvim-lspinstall/lua/lspinstall                    : install_path          :    8  : 0.0009 : 0.4   :  59 |
| vim/shared                                                                 : tbl_contains          :  182  : 0.0009 : 0.4   :  50 |
| ...te/pack/packer/start/gitsigns.nvim/lua/gitsigns/util                    : Anon                  :    0  : 0.0009 : 0.4   :   1 |
| ...-8665a96_2/share/nvim/runtime/lua/vim/lsp/diagnostic                    : _define_default_signs_:  918  : 0.0009 : 0.4   :   1 |
| ...AD-8665a96_2/share/nvim/runtime/lua/vim/lsp/protocol                    : Anon                  :  663  : 0.0008 : 0.4   :   7 |
| ...AD-8665a96_2/share/nvim/runtime/lua/vim/lsp/protocol                    : Anon                  :  740  : 0.0008 : 0.4   :   7 |
| ...AD-8665a96_2/share/nvim/runtime/lua/vim/lsp/protocol                    : Anon                  :  709  : 0.0008 : 0.4   :   7 |
| vim/shared                                                                 : startswith            :  442  : 0.0008 : 0.4   :  21 |
| ...im/site/pack/packer/start/gitsigns.nvim/lua/gitsigns                    : apply_keymaps         :  406  : 0.0008 : 0.4   :   1 |
| ...ack/packer/start/gitsigns.nvim/lua/gitsigns/mappings                    : apply_mappings        :   34  : 0.0008 : 0.4   :   1 |
| [string "return function()..."]                                            : resolve_default       :    1  : 0.0008 : 0.4   :   2 |
| ...ite/pack/packer/start/gitsigns.nvim/lua/gitsigns/git                    : ret                   :  363  : 0.0007 : 0.3   :   1 |
| ...te/pack/packer/start/gitsigns.nvim/lua/gitsigns/util                    : run_job               :   16  : 0.0007 : 0.3   :   1 |
| ...pack/packer/opt/nvim-lspconfig/lua/lspconfig/configs                    : setup                 :   33  : 0.0007 : 0.3   :   5 |
| ...cker/start/nvim-treesitter/lua/nvim-treesitter/query                    : Anon                  :    0  : 0.0007 : 0.3   :   1 |
| /Users/akinso/.config/nvim/lua/as/plugins/lspconfig                        : highlight             :   83  : 0.0007 : 0.3   :   1 |
| /Users/akinso/.config/nvim/lua/as/highlights                               : all                   :  119  : 0.0006 : 0.3   :   1 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : start                 :  438  : 0.0006 : 0.3   :   1 |
| ...ite/pack/packer/start/lsp-status.nvim/lua/lsp-status                    : config                :   64  : 0.0006 : 0.3   :   2 |
| ...ack/packer/start/telescope.nvim/lua/telescope/config                    : get                   :    4  : 0.0006 : 0.3   :  64 |
| /Users/akinso/.config/nvim/lua/as/autocommands                             : augroup               :   16  : 0.0006 : 0.3   :   2 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : _execute              :  384  : 0.0006 : 0.3   :   1 |
| /Users/akinso/.config/nvim/lua/as/highlights                               : highlight             :   68  : 0.0006 : 0.3   :  15 |
| .../pack/packer/start/telescope.nvim/lua/telescope/init                    : setup                 :   32  : 0.0005 : 0.2   :   1 |
| .../start/nvim-treesitter/lua/nvim-treesitter/highlight                    : Anon                  :    0  : 0.0005 : 0.2   :   1 |
| vim/shared                                                                 : tbl_flatten           :  333  : 0.0005 : 0.2   :  25 |
| ...HEAD-8665a96_2/share/nvim/runtime/lua/vim/treesitter                    : __index               :   14  : 0.0005 : 0.2   :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/parsers                    : __newindex            :   16  : 0.0005 : 0.2   :  57 |
| ...r-textobjects/lua/nvim-treesitter/textobjects/select                    : Anon                  :    0  : 0.0005 : 0.2   :   1 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : map                   :  132  : 0.0005 : 0.2   :  41 |
| ...cker/start/nvim-treesitter/lua/nvim-treesitter/utils                    : setup_commands        :    7  : 0.0004 : 0.2   :   4 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : inoremap              :   90  : 0.0004 : 0.2   :   4 |
| ...m/HEAD-8665a96_2/share/nvim/runtime/lua/vim/lsp/util                    : Anon                  :    0  : 0.0004 : 0.2   :   1 |
| ...pack/packer/start/nvim-bufferline.lua/lua/bufferline                    : setup_autocommands    :  805  : 0.0004 : 0.2   :   1 |
| ...rt/lsp-status.nvim/lua/lsp-status/extensions/pyls_ms                    : Anon                  :    0  : 0.0004 : 0.2   :   1 |
| ...665a96_2/share/nvim/runtime/lua/vim/treesitter/query                    : Anon                  :    0  : 0.0004 : 0.2   :   1 |
| ...acker/start/nvim-bufferline.lua/lua/bufferline/utils                    : nvim_create_augroups  :   56  : 0.0004 : 0.2   :   1 |
| vim/shared                                                                 : _tbl_flatten          :  335  : 0.0004 : 0.2   :  36 |
| ...packer/start/telescope.nvim/lua/telescope/make_entry                    : Anon                  :    0  : 0.0004 : 0.2   :   1 |
| ...ck/packer/start/gitsigns.nvim/lua/gitsigns/highlight                    : Anon                  :    0  : 0.0004 : 0.2   :   1 |
| ...packer/start/nvim-web-devicons/lua/nvim-web-devicons                    : get_highlight_name    :  858  : 0.0004 : 0.2   : 163 |
| vim/shared                                                                 : trim                  :  422  : 0.0004 : 0.2   :  12 |
| ...im/site/pack/packer/opt/nvim-compe/lua/compe/context                    : Anon                  :    0  : 0.0004 : 0.2   :   1 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : Anon                  :    0  : 0.0004 : 0.2   :   2 |
| ...e/pack/packer/start/kommentary/lua/kommentary/config                    : Anon                  :    0  : 0.0003 : 0.2   :   1 |
| .../pack/packer/start/gitsigns.nvim/lua/gitsigns/config                    : Anon                  :    0  : 0.0003 : 0.1   :   1 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : nmap                  :   90  : 0.0003 : 0.1   :   3 |
| .../start/telescope.nvim/lua/telescope/_extensions/init                    : __index               :    7  : 0.0003 : 0.1   :   1 |
| ...e/pack/packer/start/plenary.nvim/lua/plenary/scandir                    : Anon                  :    0  : 0.0003 : 0.1   :   1 |
| ...AD-8665a96_2/share/nvim/runtime/lua/vim/lsp/protocol                    : Anon                  :  641  : 0.0003 : 0.1   :   7 |
| ...ack/packer/start/gitsigns.nvim/lua/gitsigns/mappings                    : validate_option_keywor:   23  : 0.0003 : 0.1   :   9 |
| .../HEAD-8665a96_2/share/nvim/runtime/lua/vim/highlight                    : link                  :   16  : 0.0003 : 0.1   :  12 |
| .../packer/start/plenary.nvim/lua/plenary/window/border                    : Anon                  :    0  : 0.0003 : 0.1   :   1 |
| ...acker/start/telescope.nvim/lua/telescope/actions/set                    : Anon                  :    0  : 0.0003 : 0.1   :   1 |
| ...ck/packer/start/telescope.nvim/lua/telescope/_compat                    : deepcopy              :    7  : 0.0003 : 0.1   :  12 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : xmap                  :   90  : 0.0003 : 0.1   :   3 |
| ...ker/start/telescope.nvim/lua/telescope/entry_manager                    : Anon                  :    0  : 0.0003 : 0.1   :   1 |
| .../HEAD-8665a96_2/share/nvim/runtime/lua/vim/highlight                    : create                :    6  : 0.0003 : 0.1   :   8 |
| vim/shared                                                                 : maintained_parsers    :  165  : 0.0003 : 0.1   :   1 |
| ...e/pack/packer/start/plenary.nvim/lua/plenary/scandir                    : Anon                  :  261  : 0.0003 : 0.1   :   1 |
| ...cker/start/nvim-bufferline.lua/lua/bufferline/config                    : get_defaults          :    9  : 0.0003 : 0.1   :   1 |
| vim/shared                                                                 : tbl_values            :  137  : 0.0003 : 0.1   :   7 |
| ...pack/packer/opt/nvim-compe/lua/compe/utils/character                    : Anon                  :    0  : 0.0003 : 0.1   :   1 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : Anon                  :   23  : 0.0002 : 0.1   :   1 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : imap                  :   90  : 0.0002 : 0.1   :   2 |
| ...ack/packer/start/telescope.nvim/lua/telescope/config                    : dedent                :   15  : 0.0002 : 0.1   :  12 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : _shutdown             :  220  : 0.0002 : 0.1   :   1 |
| ...im/site/pack/packer/start/gitsigns.nvim/lua/gitsigns                    : setup_signs           :  574  : 0.0002 : 0.1   :   1 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : smap                  :   90  : 0.0002 : 0.1   :   2 |
| ...-8665a96_2/share/nvim/runtime/lua/vim/lsp/diagnostic                    : Anon                  :    0  : 0.0002 : 0.1   :   1 |
| ...te/pack/packer/opt/nvim-lspconfig/lua/lspconfig/util                    : root_pattern          :  248  : 0.0002 : 0.1   :  13 |
| .../pack/packer/opt/nvim-lspconfig/lua/lspconfig/texlab                    : Anon                  :    0  : 0.0002 : 0.1   :   1 |
| ...ter-textobjects/lua/nvim-treesitter/textobjects/move                    : Anon                  :    0  : 0.0002 : 0.1   :   1 |
| ...ite/pack/packer/opt/nvim-compe/lua/compe/utils/debug                    : Anon                  :    0  : 0.0002 : 0.1   :   1 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : vmap                  :   90  : 0.0002 : 0.1   :   2 |
| .../pack/packer/opt/nvim-lspconfig/lua/lspconfig/denols                    : Anon                  :    0  : 0.0002 : 0.1   :   1 |
| .../pack/packer/start/gitsigns.nvim/lua/gitsigns/config                    : resolve_default       :  313  : 0.0002 : 0.1   :  14 |
| ...im/HEAD-8665a96_2/share/nvim/runtime/lua/vim/lsp/log                    : Anon                  :    0  : 0.0002 : 0.1   :   1 |
| vim/shared                                                                 : tbl_map               :  151  : 0.0002 : 0.1   :   1 |
| ...packer/start/telescope.nvim/lua/telescope/actions/mt                    : transform_mod         :  126  : 0.0002 : 0.1   :   2 |
| ...k/packer/start/telescope.nvim/lua/telescope/mappings                    : Anon                  :    0  : 0.0002 : 0.1   :   1 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : omap                  :   90  : 0.0002 : 0.1   :   2 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/parsers                    : update_ft_to_parsernam:    6  : 0.0002 : 0.1   :  57 |
| ...ite/pack/packer/start/gitsigns.nvim/lua/gitsigns/git                    : cb                    :  371  : 0.0002 : 0.1   :   2 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/log                    : Anon                  :    0  : 0.0002 : 0.1   :   1 |
| ...-8665a96_2/share/nvim/runtime/lua/vim/lsp/diagnostic                    : define_default_sign   :  920  : 0.0002 : 0.1   :   4 |
| .../start/nvim-bufferline.lua/lua/bufferline/highlights                    : shallow_copy          :   41  : 0.0002 : 0.1   :  26 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/configs                    : recurse_modules       :  173  : 0.0002 : 0.1   :   8 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : vnoremap              :   90  : 0.0002 : 0.1   :   1 |
| vim/shared                                                                 : is_callable           :  569  : 0.0002 : 0.1   : 103 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/signs                    : sign_define           :   46  : 0.0002 : 0.1   :   5 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : _stop                 :  192  : 0.0002 : 0.1   :   2 |
| vim/shared                                                                 : tbl_add_reverse_lookup:  290  : 0.0002 : 0.1   :   5 |
| vim/shared                                                                 : available_parsers     :  122  : 0.0002 : 0.1   :   2 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/log                    : new                   :   51  : 0.0002 : 0.1   :   1 |
| ...cker/start/lsp-status.nvim/lua/lsp-status/statusline                    : _init                 :   21  : 0.0002 : 0.1   :   2 |
| .../pack/packer/opt/nvim-lspconfig/lua/lspconfig/bashls                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : close_safely          :    9  : 0.0001 : 0.1   :   8 |
| ...cker/start/nvim-bufferline.lua/lua/bufferline/colors                    : shade_color           :   11  : 0.0001 : 0.1   :   4 |
| ...vim/site/pack/packer/opt/nvim-compe/lua/compe/source                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| vim/shared                                                                 : gsplit                :   63  : 0.0001 : 0.1   :   3 |
| ...pack/packer/opt/nvim-lspconfig/lua/lspconfig/pyright                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| .../pack/packer/opt/nvim-lspconfig/lua/lspconfig/yamlls                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : t                     :   59  : 0.0001 : 0.1   :  50 |
| ...ck/packer/start/lsp-status.nvim/lua/lsp-status/timer                    : _init                 :   11  : 0.0001 : 0.1   :   2 |
| ...pack/packer/opt/nvim-lspconfig/lua/lspconfig/lspinfo                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/log                    : Anon                  :   51  : 0.0001 : 0.1   :   1 |
| ...acker/opt/nvim-lspconfig/lua/lspconfig/rust_analyzer                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| ...e/pack/packer/opt/nvim-lspconfig/lua/lspconfig/cmake                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| vim/shared                                                                 : split                 :  110  : 0.0001 : 0.1   :   2 |
| ...im/site/pack/packer/opt/nvim-lspconfig/lua/lspconfig                    : _setup                :   16  : 0.0001 : 0.1   :   1 |
| ...k/packer/opt/nvim-lspconfig/lua/lspconfig/solargraph                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| ...pack/packer/opt/nvim-lspconfig/lua/lspconfig/graphql                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : t                     :   76  : 0.0001 : 0.1   :  50 |
| ...te/pack/packer/opt/nvim-lspconfig/lua/lspconfig/util                    : create_module_commands:   49  : 0.0001 : 0.1   :   1 |
| .../pack/packer/start/nvim-autopairs/lua/nvim-autopairs                    : setup                 :   52  : 0.0001 : 0.1   :   1 |
| ...e/pack/packer/opt/nvim-lspconfig/lua/lspconfig/vuels                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| ...AD-8665a96_2/share/nvim/runtime/lua/vim/lsp/protocol                    : Anon                  :  726  : 0.0001 : 0.1   :   7 |
| .../pack/packer/opt/nvim-lspconfig/lua/lspconfig/svelte                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| ...e/pack/packer/opt/nvim-lspconfig/lua/lspconfig/gopls                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| ...vim/site/pack/packer/opt/nvim-compe/lua/compe/helper                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| ...ack/packer/opt/nvim-lspconfig/lua/lspconfig/dockerls                    : Anon                  :    0  : 0.0001 : 0.1   :   1 |
| ...ite/pack/packer/opt/nvim-lspconfig/lua/lspconfig/efm                    : Anon                  :    0  : 0.0001 : 0.0   :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/parsers                    : func                  :  549  : 0.0001 : 0.0   :  57 |
| ...e/pack/packer/opt/nvim-lspconfig/lua/lspconfig/vimls                    : Anon                  :    0  : 0.0001 : 0.0   :   1 |
| ...ack/packer/opt/nvim-lspconfig/lua/lspconfig/tsserver                    : Anon                  :    0  : 0.0001 : 0.0   :   1 |
| vim/shared                                                                 : tbl_isempty           :  198  : 0.0001 : 0.0   :   9 |
| .../packer/opt/nvim-lspconfig/lua/lspconfig/sumneko_lua                    : Anon                  :    0  : 0.0001 : 0.0   :   1 |
| ...packer/opt/nvim-lspconfig/lua/lspconfig/diagnosticls                    : Anon                  :    0  : 0.0001 : 0.0   :   1 |
| ...te/pack/packer/opt/nvim-lspconfig/lua/lspconfig/rome                    : Anon                  :    0  : 0.0001 : 0.0   :   1 |
| ...packer/opt/nvim-lspconfig/lua/lspconfig/intelephense                    : Anon                  :    0  : 0.0001 : 0.0   :   1 |
| .../start/nvim-bufferline.lua/lua/bufferline/highlights                    : hl                    :    7  : 0.0001 : 0.0   :  26 |
| .../pack/packer/start/gitsigns.nvim/lua/gitsigns/config                    : validate_config       :  301  : 0.0001 : 0.0   :   1 |
| .../pack/packer/start/telescope.nvim/lua/telescope/path                    : Anon                  :    0  : 0.0001 : 0.0   :   1 |
| ...site/pack/packer/opt/nvim-compe/lua/compe/vim_bridge                    : Anon                  :    0  : 0.0001 : 0.0   :   1 |
| ...im/HEAD-8665a96_2/share/nvim/runtime/lua/vim/lsp/rpc                    : Anon                  :    0  : 0.0001 : 0.0   :   1 |
| vim/shared                                                                 : tbl_keys              :  122  : 0.0001 : 0.0   :   5 |
| ...ck/packer/start/telescope.nvim/lua/telescope/_compat                    : deepcopy              :    2  : 0.0001 : 0.0   :  54 |
| vim/shared                                                                 : (for generator)       :   69  : 0.0001 : 0.0   :  16 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/signs                    : sign_get              :   36  : 0.0001 : 0.0   :   5 |
| ...vim/site/pack/packer/opt/nvim-compe/lua/compe/config                    : Anon                  :    0  : 0.0001 : 0.0   :   1 |
| ...HEAD-8665a96_2/share/nvim/runtime/lua/vim/treesitter                    : Anon                  :    0  : 0.0001 : 0.0   :   1 |
| ...ite/pack/packer/start/gitsigns.nvim/lua/gitsigns/git                    : parse_version         :   22  : 0.0001 : 0.0   :   1 |
| ...cker/start/nvim-bufferline.lua/lua/bufferline/colors                    : get_hex               :   58  : 0.0001 : 0.0   :   6 |
| vim/shared                                                                 : available_servers     :  122  : 0.0001 : 0.0   :   1 |
| [string "..."]                                                             : func                  :    0  : 0.0001 : 0.0   :  57 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/configs                    : is_module             :  396  : 0.0001 : 0.0   :  19 |
| vim                                                                        : __index               :  370  : 0.0001 : 0.0   :   7 |
| ...pack/packer/opt/nvim-compe/lua/compe/utils/character                    : Anon                  :    7  : 0.0001 : 0.0   :  26 |
| ...im/site/pack/packer/opt/nvim-compe/lua/compe/context                    : new_empty             :    7  : 0.0001 : 0.0   :   1 |
| ...im/site/pack/packer/opt/nvim-compe/lua/compe/context                    : new                   :   16  : 0.0001 : 0.0   :   1 |
| ...pack/packer/opt/nvim-compe/lua/compe/utils/character                    : Anon                  :    2  : 0.0001 : 0.0   :  26 |
| .../nvim/site/pack/packer/opt/nvim-compe/lua/compe/init                    : setup                 :   41  : 0.0001 : 0.0   :   1 |
| ...acker/start/plenary.nvim/data/plenary/filetypes/base                    : Anon                  :    0  : 0.0001 : 0.0   :   2 |
| ...vim/site/pack/packer/opt/nvim-compe/lua/compe/config                    : setup                 :   13  : 0.0001 : 0.0   :   1 |
| ...art/lsp-status.nvim/lua/lsp-status/extensions/clangd                    : Anon                  :    0  : 0.0001 : 0.0   :   1 |
| ...vim/site/pack/packer/opt/nvim-compe/lua/compe/config                    : _normalize            :   47  : 0.0001 : 0.0   :   1 |
| ...cker/start/nvim-bufferline.lua/lua/bufferline/colors                    : to_rgb                :    3  : 0.0001 : 0.0   :   5 |
-------------------------------------------------------------------------------------------------------------------------------------
| ...cker/start/nvim-treesitter/lua/nvim-treesitter/utils                    : get_cache_dir         :   48  : ~      : ~     :   1 |
| ...acker/opt/nvim-lspinstall/lua/lspinstall/servers/css                    : Anon                  :    0  : ~      : ~     :   1 |
| ...cker/opt/nvim-lspinstall/lua/lspinstall/servers/html                    : Anon                  :    0  : ~      : ~     :   1 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/debug                    : Anon                  :    0  : ~      : ~     :   1 |
| ...cker/start/nvim-treesitter/lua/nvim-treesitter/utils                    : get_parser_install_dir:   71  : ~      : ~     :   1 |
| ...er/start/plenary.nvim/data/plenary/filetypes/builtin                    : Anon                  :    0  : ~      : ~     :   2 |
| ...cker/opt/nvim-lspinstall/lua/lspinstall/servers/json                    : Anon                  :    0  : ~      : ~     :   1 |
| ...ack/packer/start/nvim-treesitter/lua/nvim-treesitter                    : define_modules        :   25  : ~      : ~     :   1 |
| vim                                                                        : __index               :  342  : ~      : ~     :  11 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : get_defaults          :   55  : ~      : ~     :  16 |
| ...site/pack/packer/start/plenary.nvim/lua/plenary/path                    : Anon                  :    0  : ~      : ~     :   1 |
| [string "return function()..."]                                            : Anon                  :    0  : ~      : ~     :   2 |
| ...te/pack/packer/opt/nvim-lspconfig/lua/lspconfig/util                    : Anon                  :    0  : ~      : ~     :   1 |
| ...-8665a96_2/share/nvim/runtime/lua/vim/lsp/diagnostic                    : make_highlight_map    :  105  : ~      : ~     :   5 |
| [builtin:len]                                                              : len                   :   -1  : ~      : ~     :  18 |
| ...im/HEAD-8665a96_2/share/nvim/runtime/lua/vim/lsp/rpc                    : Anon                  :  137  : ~      : ~     :   7 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : _prepare_pipes        :  363  : ~      : ~     :   1 |
| ...pack/packer/opt/nvim-compe/lua/compe/utils/character                    : Anon                  :   12  : ~      : ~     :  10 |
| ...cker/start/nvim-treesitter/lua/nvim-treesitter/utils                    : Anon                  :    0  : ~      : ~     :   1 |
| ...nvim-treesitter/lua/nvim-treesitter/query_predicates                    : Anon                  :    0  : ~      : ~     :   1 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : _reset                :  165  : ~      : ~     :   2 |
| ...ck/packer/start/gitsigns.nvim/lua/gitsigns/highlight                    : setup_highlight       :   61  : ~      : ~     :   5 |
| ...ite/pack/packer/start/gitsigns.nvim/lua/gitsigns/git                    : _user_on_exit         :  384  : ~      : ~     :   1 |
| ...im/site/pack/packer/start/gitsigns.nvim/lua/gitsigns                    : setup_decoration_provi:  643  : ~      : ~     :   1 |
| ..._2/share/nvim/runtime/lua/vim/treesitter/highlighter                    : Anon                  :    0  : ~      : ~     :   1 |
| ...ck/packer/start/telescope.nvim/lua/telescope/sorters                    : Anon                  :    0  : ~      : ~     :   1 |
| ...te/pack/packer/opt/nvim-lspconfig/lua/lspconfig/util                    : Anon                  :   78  : ~      : ~     :   1 |
| ...tart/telescope.nvim/lua/telescope/pickers/highlights                    : Anon                  :    0  : ~      : ~     :   1 |
| ...te/pack/packer/opt/nvim-lspconfig/lua/lspconfig/util                    : server_per_root_dir_ma:  195  : ~      : ~     :   5 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async                    : callback              :   54  : ~      : ~     :   1 |
| ...cker/start/nvim-bufferline.lua/lua/bufferline/colors                    : color_is_bright       :   42  : ~      : ~     :   1 |
| ...r-textobjects/lua/nvim-treesitter/textobjects/attach                    : Anon                  :    0  : ~      : ~     :   1 |
| ...e/pack/packer/opt/nvim-compe/lua/compe/utils/boolean                    : get                   :    4  : ~      : ~     :  14 |
| ...te/pack/packer/opt/nvim-compe/lua/compe/utils/string                    : Anon                  :    0  : ~      : ~     :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/configs                    : define_modules        :  318  : ~      : ~     :   1 |
| ...eesitter-textobjects/lua/nvim-treesitter-textobjects                    : Anon                  :    0  : ~      : ~     :   1 |
| ...ack/packer/start/plenary.nvim/lua/plenary/functional                    : Anon                  :    0  : ~      : ~     :   1 |
| .../pack/packer/start/gitsigns.nvim/lua/gitsigns/repeat                    : Anon                  :    0  : ~      : ~     :   1 |
| ...ter-textobjects/lua/nvim-treesitter/textobjects/swap                    : Anon                  :    0  : ~      : ~     :   1 |
| ...e/pack/packer/start/plenary.nvim/lua/plenary/scandir                    : Anon                  :  271  : ~      : ~     :   1 |
| ...e/pack/packer/start/kommentary/lua/kommentary/config                    : configure_language    :  193  : ~      : ~     :   1 |
| .../nvim/site/pack/packer/opt/nvim-compe/lua/compe/init                    : enable                :   25  : ~      : ~     :   8 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : Anon                  :   40  : ~      : ~     :   1 |
| ...tobjects/lua/nvim-treesitter/textobjects/lsp_interop                    : Anon                  :    0  : ~      : ~     :   1 |
| ...im/HEAD-8665a96_2/share/nvim/runtime/lua/vim/lsp/buf                    : Anon                  :    0  : ~      : ~     :   1 |
| ...im/site/pack/packer/start/gitsigns.nvim/lua/gitsigns                    : setup_command         :  633  : ~      : ~     :   1 |
| ...ack/packer/start/gitsigns.nvim/lua/gitsigns/debounce                    : debounce_trailing     :    8  : ~      : ~     :   1 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async                    : async                 :   49  : ~      : ~     :   4 |
| .../pack/packer/start/telescope.nvim/lua/telescope/path                    : Anon                  :   23  : ~      : ~     :   1 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : has                   :   51  : ~      : ~     :   1 |
| ...cker/start/lsp-status.nvim/lua/lsp-status/statusline                    : make_statusline_compon:   13  : ~      : ~     :   8 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async                    : sync                  :   71  : ~      : ~     :   4 |
| ...cker/start/nvim-treesitter/lua/nvim-treesitter/utils                    : get_path_sep          :   20  : ~      : ~     :   1 |
| ...ite/pack/packer/start/kommentary/lua/kommentary/util                    : enum                  :  101  : ~      : ~     :   1 |
| ...te/pack/packer/opt/nvim-compe/lua/compe/utils/compat                    : Anon                  :    0  : ~      : ~     :   1 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/hunks                    : Anon                  :    0  : ~      : ~     :   1 |
| ...r-textobjects/lua/nvim-treesitter/textobjects/shared                    : Anon                  :    0  : ~      : ~     :   1 |
| ...ck/packer/start/telescope.nvim/lua/telescope/finders                    : _callable_obj         :    8  : ~      : ~     :   3 |
| ...r-textobjects/lua/nvim-treesitter/textobjects/attach                    : make_attach           :    7  : ~      : ~     :   3 |
| ...pack/packer/start/telescope.nvim/lua/telescope/utils                    : Anon                  :  252  : ~      : ~     :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/install                    : install               :  271  : ~      : ~     :   4 |
| ...r/start/nvim-treesitter/lua/nvim-treesitter/ts_utils                    : Anon                  :    0  : ~      : ~     :   1 |
| ...lescope.nvim/lua/telescope/previewers/term_previewer                    : Anon                  :   23  : ~      : ~     :   1 |
| ...ack/packer/start/plenary.nvim/lua/plenary/functional                    : if_nil                :   55  : ~      : ~     :   3 |
| ...AD-8665a96_2/share/nvim/runtime/lua/vim/lsp/handlers                    : make_call_hierarchy_ha:  340  : ~      : ~     :   2 |
| ...r-textobjects/lua/nvim-treesitter/textobjects/attach                    : make_detach           :   28  : ~      : ~     :   3 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/caching                    : create_buffer_cache   :    8  : ~      : ~     :   2 |
| ...cker/start/nvim-treesitter/lua/nvim-treesitter/query                    : get_query_guard       :   14  : ~      : ~     :   4 |
| ...665a96_2/share/nvim/runtime/lua/vim/treesitter/query                    : add_predicate         :  266  : ~      : ~     :   5 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/tsrange                    : Anon                  :    0  : ~      : ~     :   1 |
| .../pack/packer/start/nvim-autopairs/lua/nvim-autopairs                    : Anon                  :    0  : ~      : ~     :   1 |
| .../pack/packer/start/gitsigns.nvim/lua/gitsigns/repeat                    : mk_repeatable         :   10  : ~      : ~     :   3 |
| ...site/pack/packer/start/plenary.nvim/lua/plenary/path                    : Anon                  :  241  : ~      : ~     :   1 |
| ...lescope.nvim/lua/telescope/pickers/layout_strategies                    : Anon                  :    0  : ~      : ~     :   1 |
| vim                                                                        : __index               :  265  : ~      : ~     :   3 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/debug                    : dprint                :    6  : ~      : ~     :   1 |
| ...e/pack/packer/start/plenary.nvim/lua/plenary/scandir                    : Anon                  :  309  : ~      : ~     :   1 |
| ...cker/start/lsp-status.nvim/lua/lsp-status/statusline                    : Anon                  :    0  : ~      : ~     :   1 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : start_shutdown_check  :   22  : ~      : ~     :   1 |
| ...pack/packer/start/telescope.nvim/lua/telescope/utils                    : Anon                  :  141  : ~      : ~     :   1 |
| ...eesitter/lua/nvim-treesitter/shell_command_selectors                    : Anon                  :    0  : ~      : ~     :   1 |
| ...t/telescope.nvim/lua/telescope/pickers/entry_display                    : Anon                  :    0  : ~      : ~     :   1 |
| ...e/pack/packer/start/kommentary/lua/kommentary/config                    : get_default_config    :   14  : ~      : ~     :   4 |
| ...ck/packer/start/gitsigns.nvim/lua/gitsigns/highlight                    : isGitSignHl           :   55  : ~      : ~     :   5 |
| ...te/pack/packer/start/gitsigns.nvim/lua/gitsigns/util                    : Anon                  :   32  : ~      : ~     :   1 |
| ...pack/packer/start/telescope.nvim/lua/telescope/utils                    : Anon                  :  369  : ~      : ~     :   1 |
| ...pack/packer/start/telescope.nvim/lua/telescope/utils                    : Anon                  :  273  : ~      : ~     :   1 |
| ...im/site/pack/packer/opt/nvim-compe/lua/compe/pattern                    : Anon                  :    0  : ~      : ~     :   1 |
| ...ack/packer/start/plenary.nvim/lua/plenary/functional                    : select_only           :   63  : ~      : ~     :   3 |
| ...ck/packer/start/telescope.nvim/lua/telescope/_compat                    : Anon                  :    0  : ~      : ~     :   1 |
| ...site/pack/packer/opt/nvim-compe/lua/compe/completion                    : guard                 :   14  : ~      : ~     :   3 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async                    : arun                  :   78  : ~      : ~     :   2 |
| .../start/telescope.nvim/lua/telescope/builtin/internal                    : Anon                  :  864  : ~      : ~     :   1 |
| ...ker/start/telescope.nvim/lua/telescope/actions/state                    : Anon                  :    0  : ~      : ~     :   1 |
| ...tart/lsp-status.nvim/lua/lsp-status/current_function                    : Anon                  :    0  : ~      : ~     :   1 |
| ...pack/packer/start/telescope.nvim/lua/telescope/utils                    : get_separator         :    8  : ~      : ~     :   2 |
| .../HEAD-8665a96_2/share/nvim/runtime/lua/vim/highlight                    : Anon                  :    0  : ~      : ~     :   1 |
| .../start/telescope.nvim/lua/telescope/_extensions/init                    : Anon                  :    0  : ~      : ~     :   1 |
| .../nvim/site/pack/packer/opt/nvim-compe/lua/compe/init                    : suppress              :   11  : ~      : ~     :   5 |
| vim/shared                                                                 : (for generator)       :   81  : ~      : ~     :  19 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async                    : Anon                  :    0  : ~      : ~     :   1 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : _pipes_are_closed     :  199  : ~      : ~     :   1 |
| ...ack/packer/start/lsp-status.nvim/lua/lsp-status/util                    : Anon                  :    0  : ~      : ~     :   1 |
| ...665a96_2/share/nvim/runtime/lua/vim/treesitter/query                    : Anon                  :  177  : ~      : ~     :   1 |
| [string "return {..."]                                                     : resolve_default       :    0  : ~      : ~     :   1 |
| ...packer/start/telescope.nvim/lua/telescope/actions/mt                    : create                :   17  : ~      : ~     :   2 |
| ...ker/start/lsp-status.nvim/lua/lsp-status/diagnostics                    : Anon                  :    0  : ~      : ~     :   1 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/signs                    : Anon                  :    0  : ~      : ~     :   1 |
| ...acker/start/telescope.nvim/lua/telescope/builtin/lsp                    : Anon                  :  283  : ~      : ~     :   1 |
| ...ker/start/telescope.nvim/lua/telescope/builtin/files                    : Anon                  :  407  : ~      : ~     :   1 |
| ...im/site/pack/packer/opt/nvim-compe/lua/compe/matcher                    : Anon                  :    0  : ~      : ~     :   1 |
| ...er/start/telescope.nvim/lua/telescope/config/resolve                    : Anon                  :    0  : ~      : ~     :   1 |
| [string "return function(status)..."]                                      : Anon                  :    0  : ~      : ~     :   1 |
| ...pack/packer/opt/nvim-compe/lua/compe/utils/character                    : Anon                  :   17  : ~      : ~     :   2 |
| ...m/HEAD-8665a96_2/share/nvim/runtime/lua/vim/lsp/util                    : sort_by_key           :   69  : ~      : ~     :   2 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async                    : Anon                  :   50  : ~      : ~     :   1 |
| ...neovim/HEAD-8665a96_2/share/nvim/runtime/lua/vim/lsp                    : with                  : 1289  : ~      : ~     :   1 |
| ...ker/start/telescope.nvim/lua/telescope/pickers/multi                    : Anon                  :    0  : ~      : ~     :   1 |
| ...ite/pack/packer/start/kommentary/lua/kommentary/util                    : Anon                  :    0  : ~      : ~     :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/caching                    : Anon                  :    0  : ~      : ~     :   1 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/tbl                    : Anon                  :    0  : ~      : ~     :   1 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/popup                    : Anon                  :    0  : ~      : ~     :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/parsers                    : Anon                  :  558  : ~      : ~     :   1 |
| ...im/site/pack/packer/start/popup.nvim/lua/popup/utils                    : Anon                  :    0  : ~      : ~     :   1 |
| ...im/site/pack/packer/opt/nvim-compe/lua/compe/context                    : get_before_char       :   67  : ~      : ~     :   1 |
| .../start/telescope.nvim/lua/telescope/pickers/scroller                    : Anon                  :    0  : ~      : ~     :   1 |
| ...cker/start/lsp-status.nvim/lua/lsp-status/statusline                    : _get_component_functio:  117  : ~      : ~     :   2 |
| ...packer/start/nvim-web-devicons/lua/nvim-web-devicons                    : has_loaded            :  917  : ~      : ~     :   2 |
| ...art/lsp-status.nvim/lua/lsp-status/extensions/clangd                    : _init                 :    6  : ~      : ~     :   2 |
| ...rt/telescope.nvim/lua/telescope/previewers/previewer                    : Anon                  :    0  : ~      : ~     :   1 |
| ...k/packer/start/telescope.nvim/lua/telescope/debounce                    : Anon                  :    0  : ~      : ~     :   1 |
| ...acker/start/telescope.nvim/lua/telescope/builtin/git                    : Anon                  :  192  : ~      : ~     :   1 |
| ...pack/packer/start/telescope.nvim/lua/telescope/state                    : Anon                  :    0  : ~      : ~     :   1 |
| ...665a96_2/share/nvim/runtime/lua/vim/treesitter/query                    : add_directive         :  279  : ~      : ~     :   1 |
| ...ack/packer/start/gitsigns.nvim/lua/gitsigns/mappings                    : Anon                  :    0  : ~      : ~     :   1 |
| ...t/nvim-lspinstall/lua/lspinstall/servers/tailwindcss                    : Anon                  :    0  : ~      : ~     :   1 |
| ...fzf-writer.nvim/lua/telescope/_extensions/fzf_writer                    : setup                 :   17  : ~      : ~     :   1 |
| ...site/pack/packer/start/plenary.nvim/lua/plenary/path                    : Anon                  :   22  : ~      : ~     :   1 |
| ...acker/start/lsp-status.nvim/lua/lsp-status/messaging                    : _init                 :    5  : ~      : ~     :   2 |
| ...cker/start/nvim-treesitter/lua/nvim-treesitter/utils                    : generate_join         :   30  : ~      : ~     :   2 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : Anon                  :  274  : ~      : ~     :   2 |
| ...acker/start/lsp-status.nvim/lua/lsp-status/messaging                    : register_progress     :   98  : ~      : ~     :   1 |
| ...ck/packer/start/telescope.nvim/lua/telescope/_compat                    : Anon                  :    1  : ~      : ~     :   1 |
| ...packer/start/telescope.nvim/lua/telescope/actions/mt                    : Anon                  :    0  : ~      : ~     :   1 |
| ...tart/lsp-status.nvim/lua/lsp-status/current_function                    : _init                 :    7  : ~      : ~     :   2 |
| ...ack/packer/start/gitsigns.nvim/lua/gitsigns/debounce                    : Anon                  :    0  : ~      : ~     :   1 |
| .../pack/packer/opt/nvim-lspconfig/lua/lspconfig/_lspui                    : Anon                  :    0  : ~      : ~     :   1 |
| ...ite/pack/packer/opt/nvim-compe/lua/compe/utils/async                    : Anon                  :    0  : ~      : ~     :   1 |
| ...rt/lsp-status.nvim/lua/lsp-status/extensions/pyls_ms                    : _init                 :    6  : ~      : ~     :   2 |
| ...e/pack/packer/opt/nvim-compe/lua/compe/utils/boolean                    : Anon                  :    0  : ~      : ~     :   1 |
| .../pack/packer/start/gitsigns.nvim/lua/gitsigns/status                    : Anon                  :    0  : ~      : ~     :   1 |
| ...ite/pack/packer/opt/nvim-compe/lua/compe/utils/cache                    : Anon                  :    0  : ~      : ~     :   1 |
| ...ck/packer/start/lsp-status.nvim/lua/lsp-status/timer                    : Anon                  :    0  : ~      : ~     :   1 |
| ...ck/packer/start/plenary.nvim/lua/plenary/window/init                    : Anon                  :    0  : ~      : ~     :   1 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : _create_uv_options    :  260  : ~      : ~     :   1 |
| ...start/telescope.nvim/lua/telescope/algos/linked_list                    : Anon                  :    0  : ~      : ~     :   1 |
| ...a96_2/share/nvim/runtime/lua/vim/treesitter/language                    : Anon                  :    0  : ~      : ~     :   1 |
| ...ite/pack/packer/start/gitsigns.nvim/lua/gitsigns/git                    : defer                 :  362  : ~      : ~     :   1 |
| ...acker/start/plenary.nvim/lua/plenary/context_manager                    : Anon                  :    0  : ~      : ~     :   1 |
| [string "return { interval = 1000 }"]                                      : resolve_default       :    0  : ~      : ~     :   1 |
| .../start/telescope.nvim/lua/telescope/_extensions/init                    : set_config            :   58  : ~      : ~     :   1 |
| ...im/site/pack/packer/start/gitsigns.nvim/lua/gitsigns                    : add_debug_functions   :  598  : ~      : ~     :   1 |
| .../start/telescope.nvim/lua/telescope/_extensions/init                    : Anon                  :   50  : ~      : ~     :   1 |
| ...pack/packer/start/nvim-bufferline.lua/lua/bufferline                    : validate_prefs        :  845  : ~      : ~     :   1 |
| .../pack/packer/opt/nvim-compe/lua/compe/utils/callback                    : Anon                  :    0  : ~      : ~     :   1 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : shutdown_factory      :   39  : ~      : ~     :   1 |
| ...ack/packer/start/telescope.nvim/lua/telescope/themes                    : Anon                  :    0  : ~      : ~     :   1 |
| ...e/pack/packer/start/plenary.nvim/lua/plenary/scandir                    : Anon                  :  204  : ~      : ~     :   1 |
| ...packer/start/telescope.nvim/lua/telescope/from_entry                    : Anon                  :    0  : ~      : ~     :   1 |
| ...e/pack/packer/start/plenary.nvim/lua/plenary/scandir                    : Anon                  :  242  : ~      : ~     :   1 |
| ...pack/packer/start/nvim-bufferline.lua/lua/bufferline                    : convert_hl_tables     :  879  : ~      : ~     :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/install                    : reset_progress_counter:   20  : ~      : ~     :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/configs                    : get_ignored_parser_ins:  417  : ~      : ~     :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/parsers                    : get_parser_configs    :  552  : ~      : ~     :   1 |
| ...ite/pack/packer/opt/nvim-compe/lua/compe/utils/async                    : guard                 :   76  : ~      : ~     :   1 |
| .../start/plenary.nvim/lua/plenary/profile/lua_profiler                    : stop                  :  158  : ~      : ~     :   1 |
| ...packer/opt/nvim-lspinstall/lua/lspinstall/servers/go                    : Anon                  :    0  : ~      : ~     :   1 |
| ...acker/opt/nvim-lspinstall/lua/lspinstall/servers/lua                    : Anon                  :    0  : ~      : ~     :   1 |
| /Users/akinso/.config/nvim/lua/as/highlights                               : hl_value              :   95  : ~      : ~     :   1 |
| .../nvim-lspinstall/lua/lspinstall/servers/diagnosticls                    : Anon                  :    0  : ~      : ~     :   1 |
| /Users/akinso/.config/nvim/lua/as/utils                                    : stop                  :   38  : ~      : ~     :   1 |
| ...pt/nvim-lspinstall/lua/lspinstall/servers/dockerfile                    : Anon                  :    0  : ~      : ~     :   1 |
| ...acker/opt/nvim-lspinstall/lua/lspinstall/servers/php                    : Anon                  :    0  : ~      : ~     :   1 |
| ...cker/opt/nvim-lspinstall/lua/lspinstall/servers/bash                    : Anon                  :    0  : ~      : ~     :   1 |
| ...cker/opt/nvim-lspinstall/lua/lspinstall/servers/rome                    : Anon                  :    0  : ~      : ~     :   1 |
| ...r/opt/nvim-lspinstall/lua/lspinstall/servers/graphql                    : Anon                  :    0  : ~      : ~     :   1 |
| vim                                                                        : hl_value              :  272  : ~      : ~     :   1 |
| ...acker/opt/nvim-lspinstall/lua/lspinstall/servers/efm                    : Anon                  :    0  : ~      : ~     :   1 |
| ...er/opt/nvim-lspinstall/lua/lspinstall/servers/python                    : Anon                  :    0  : ~      : ~     :   1 |
| vim/shared                                                                 : Anon                  :  246  : ~      : ~     :  21 |
| .../site/pack/packer/opt/nvim-lspinstall/lua/lspinstall                    : func                  :   91  : ~      : ~     :  25 |
| ...ker/opt/nvim-lspinstall/lua/lspinstall/servers/cmake                    : Anon                  :    0  : ~      : ~     :   1 |
| ...pt/nvim-lspinstall/lua/lspinstall/servers/typescript                    : Anon                  :    0  : ~      : ~     :   1 |
| ...acker/opt/nvim-lspinstall/lua/lspinstall/servers/cpp                    : Anon                  :    0  : ~      : ~     :   1 |
| vim                                                                        : getcwd                :  272  : ~      : ~     :   4 |
| ...pack/packer/opt/nvim-lspconfig/lua/lspconfig/configs                    : Anon                  :    0  : ~      : ~     :   1 |
| ...im/site/pack/packer/opt/nvim-lspconfig/lua/lspconfig                    : Anon                  :    0  : ~      : ~     :   1 |
| vim                                                                        : Anon                  :  352  : ~      : ~     :   1 |
| ...cker/opt/nvim-lspinstall/lua/lspinstall/servers/ruby                    : Anon                  :    0  : ~      : ~     :   1 |
| vim                                                                        : __index               :  402  : ~      : ~     :   1 |
| ...acker/opt/nvim-lspinstall/lua/lspinstall/servers/vue                    : Anon                  :    0  : ~      : ~     :   1 |
| ...cker/opt/nvim-lspinstall/lua/lspinstall/servers/deno                    : Anon                  :    0  : ~      : ~     :   1 |
| ...cker/opt/nvim-lspinstall/lua/lspinstall/servers/rust                    : Anon                  :    0  : ~      : ~     :   1 |
| ...acker/opt/nvim-lspinstall/lua/lspinstall/servers/vim                    : Anon                  :    0  : ~      : ~     :   1 |
| .../site/pack/packer/opt/nvim-lspinstall/lua/lspinstall                    : available_servers     :   86  : ~      : ~     :   1 |
| ...er/opt/nvim-lspinstall/lua/lspinstall/servers/svelte                    : Anon                  :    0  : ~      : ~     :   1 |
| ...cker/opt/nvim-lspinstall/lua/lspinstall/servers/yaml                    : Anon                  :    0  : ~      : ~     :   1 |
| .../site/pack/packer/opt/nvim-lspinstall/lua/lspinstall                    : installed_servers     :   90  : ~      : ~     :   1 |
| ...ker/opt/nvim-lspinstall/lua/lspinstall/servers/latex                    : Anon                  :    0  : ~      : ~     :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/parsers                    : available_parsers     :  544  : ~      : ~     :   2 |
| vim                                                                        : sign_getdefined       :  272  : ~      : ~     :   9 |
| vim                                                                        : sign_define           :  272  : ~      : ~     :  15 |
| vim                                                                        : empty_dict            :  259  : ~      : ~     : 1097|
| vim/shared                                                                 : tbl_deep_extend       :  259  : ~      : ~     :  16 |
| ...im/site/pack/packer/start/gitsigns.nvim/lua/gitsigns                    : Anon                  :  656  : ~      : ~     :   1 |
| vim                                                                        : Anon                  :  272  : ~      : ~     :   1 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : new                   :   79  : ~      : ~     :   1 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async                    : await                 :   94  : ~      : ~     :   1 |
| .../site/pack/packer/start/plenary.nvim/lua/plenary/job                    : on_output             :  273  : ~      : ~     :   2 |
| ...te/pack/packer/start/gitsigns.nvim/lua/gitsigns/util                    : get_jit_os            :   25  : ~      : ~     :   1 |
| vim                                                                        : isdirectory           :  272  : ~      : ~     :   1 |
| vim                                                                        : __index               :  337  : ~      : ~     :  20 |
| vim                                                                        : getenv                :  272  : ~      : ~     :   9 |
| vim                                                                        : __index               :  346  : ~      : ~     :  11 |
| vim                                                                        : expand                :  272  : ~      : ~     :   3 |
| vim                                                                        : __newindex            :  326  : ~      : ~     :  87 |
| vim/shared                                                                 : tbl_extend            :  246  : ~      : ~     : 113 |
| vim                                                                        : stdpath               :  272  : ~      : ~     :  63 |
| vim                                                                        : which_key#register    :  272  : ~      : ~     :   2 |
| ...cker/start/nvim-treesitter/lua/nvim-treesitter/utils                    : difference            :  163  : ~      : ~     :   1 |
| vim                                                                        : has                   :  272  : ~      : ~     :   9 |
| ...ck/packer/start/telescope.nvim/lua/telescope/_compat                    : deepcopy              :   48  : ~      : ~     :  66 |
| ...acker/start/telescope.nvim/lua/telescope/builtin/lsp                    : Anon                  :    0  : ~      : ~     :   1 |
| .../start/telescope.nvim/lua/telescope/builtin/internal                    : Anon                  :    0  : ~      : ~     :   1 |
| ...fzf-writer.nvim/lua/telescope/_extensions/fzf_writer                    : Anon                  :    0  : ~      : ~     :   1 |
| .../pack/packer/start/telescope.nvim/lua/telescope/init                    : Anon                  :   45  : ~      : ~     :   1 |
| ...im/HEAD-8665a96_2/share/nvim/runtime/lua/vim/lsp/log                    : path_join             :   22  : ~      : ~     :   1 |
| ...acker/start/telescope.nvim/lua/telescope/builtin/git                    : Anon                  :    0  : ~      : ~     :   1 |
| ...pack/packer/start/telescope.nvim/lua/telescope/utils                    : defaulter             :  158  : ~      : ~     :  15 |
| vim                                                                        : executable            :  272  : ~      : ~     :   2 |
| vim                                                                        : get_package_path      :  272  : ~      : ~     :   1 |
| ...cker/start/nvim-treesitter/lua/nvim-treesitter/utils                    : get_package_path      :   40  : ~      : ~     :   1 |
| ...cker/start/nvim-treesitter/lua/nvim-treesitter/utils                    : join_path             :   31  : ~      : ~     :   1 |
| ...er/start/nvim-treesitter/lua/nvim-treesitter/parsers                    : maintained_parsers    :  548  : ~      : ~     :   1 |
| vim                                                                        : mkdir                 :  272  : ~      : ~     :   1 |
| ...-8665a96_2/share/nvim/runtime/lua/vim/lsp/diagnostic                    : _make_namespace_table :  143  : ~      : ~     :   2 |
| vim                                                                        : __newindex            :  333  : ~      : ~     :   2 |
| vim                                                                        : hlID                  :  272  : ~      : ~     :   7 |
| vim                                                                        : synIDattr             :  272  : ~      : ~     :   6 |
| ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async                    : await_main            :   98  : ~      : ~     :   1 |
| ...ack/packer/start/telescope.nvim/lua/telescope/config                    : get                   :   52  : ~      : ~     :  64 |
| ...ker/start/telescope.nvim/lua/telescope/builtin/files                    : Anon                  :    0  : ~      : ~     :   1 |
| ...packer/start/telescope.nvim/lua/telescope/actions/mt                    : __add                 :   45  : ~      : ~     :  10 |
| ...packer/start/telescope.nvim/lua/telescope/actions/mt                    : transform             :  122  : ~      : ~     :  51 |
| ...e/pack/packer/start/telescope.nvim/lua/telescope/log                    : Anon                  :    0  : ~      : ~     :   1 |
-------------------------------------------------------------------------------------------------------------------------------------

I think something like this will be quite useful since as you can see from the profile there are quite a few lua plugins doing expensive things on startup. A user could use something like this to start to figure out what's going on and what needs optimisation or an issue raised on a plugin's repo

@wbthomason
Copy link
Owner Author

@akinsho I implemented a basic timed_chunk function. In my limited testing, it seems to work, though the output is still super ugly. I think it's also worth considering whether the output should go in every compiled file, or just when e.g. a profile argument is passed to packer.compile().

It would probably also be good to add line number information to the profile output.

@akinsho
Copy link
Collaborator

akinsho commented Mar 30, 2021

@wbthomason I think the question of if it should go in every file is one of the cost of doing so. If it's negligible than I think its useful not to have an extra layer that someone would have to discover in order to unearth this feature. If it's costly then a flag of some kind is a good idea.

I think it'd be cool to just point a user at the compiled file so they could just inspect profile data without a bunch of faff but I'm guessing the profiling maybe adds time onto startup so is at least a little costly

@wbthomason
Copy link
Owner Author

Ah, do you mean outputting the profile information as a comment to the end of the compiled file or something? That would be neat. I should probably also implement sorting.

Regarding the overhead of profiling: I should run experiments to see if this is significant, but the basic overhead is 2 function calls per timed "chunk". Each of these calls is pretty lightweight - basically gets the time and accesses a table with string keys - but this could add up.

@akinsho
Copy link
Collaborator

akinsho commented Apr 8, 2021

@wbthomason I just tried this out since I'm really trying to get on top of my config's startup time which is a constant point of annoyance for me 😅 . It works quite well I had a timed_chunk is a table error but wrapping it in a vim.inspect worked fine.

I could push some commits to this branch to work on tidying up the formatting a bit if you're open to that. Was thinking that if PACKER_PROFILE is truthy then open a display with the profile data inside it. i.e. it could be saved under some _G.packer_profile data and the user could run PackerProfileOutput or something to see the results?

maybe that's too much for a firs pass at this though 🤷🏿

@akinsho
Copy link
Collaborator

akinsho commented Apr 8, 2021

@wbthomason I tinkered with this a little locally to get it into a display. I also changed the sort order to slowest first.

image

I was immediately able to pick up a buggy personal plugin I'm developing as the culprit of my startup time which was super helpful. I think this is quite valuable with a few little tweaks.

I can push (well probably a branch into your branch since I can't push to your branch) what I changed locally it's not a lot. I could potentially add some syntax rules for just this buffer to make the times and types of event stand out a bit better.

Regarding usage I think using the ENV_VAR is a little bit of a hurdle for users. I think maybe setting something in a user's config might be a slightly less unwieldy mechanism although I think discoverability is a bit of an issue already so maybe neither will be as good as just generating this table and letting users access it as they please via PackerProfileOutput or something.

EDIT: then again perhaps profiling is a niche enough thing to want to do to warrant specifying something in your config, alternatively thinking about plugins like startuptime that don't require anything like the above maybe there can just be a single command that runs packer.compile(should_profile = true) and then sources it although not sure if that will give erroneous result because it's already been run once

@wbthomason
Copy link
Owner Author

@akinsho This all sounds good, thanks for tackling the formatting (I admit, output formatting/display is some of my least favorite code to work on for packer).

I'm happy to just add you as a collaborator on the repo, if you'd like - you do a lot of work for packer already. Or, if you'd prefer, I can just enable you to push to this branch.

@wbthomason
Copy link
Owner Author

Regarding how to enable/disable the feature: I think I favor a profile Boolean, which can be set in the config (default to false) or passed to packer.compile to override the config value. Probably also let it be passed via the relevant commands to make it easier?

@wbthomason
Copy link
Owner Author

Oh, and for the concern over multiple sourcing: we can add a global flag to prevent the issue.

@akinsho
Copy link
Collaborator

akinsho commented Apr 8, 2021

Sounds good @wbthomason I'd be happy to be added as a collaborator, it's an interesting problem space and I'd like to help out when I can.

In which case I'll tidy up what I've got locally and push to this branch. I can add in the config variable as well as the command + argument.

Regarding the multiple sourcing thing I guess it's more a question of if you can reliably re-run packer.compile and check the output of the profiling and get reliable results consistently if you just resourced the file i.e. would everything just load again, but I guess it's more of a run once on startup and restart in order to get a correct profile again.

@akinsho akinsho force-pushed the feat-profile-compiled-code branch from 4a3d493 to c365b67 Compare April 8, 2021 21:17
@akinsho
Copy link
Collaborator

akinsho commented Apr 8, 2021

@wbthomason heads up that I've rebased this on master and added in my changes. So a user can set

config = {
 --- blah
 profile = {
  enable = true
 }
}

as well as

:PackerCompile profile=true
:PackerCompile profile=false

I decided to go with = style args so a user could specify one option or the other i.e. force disable profiling for the next run etc. and also using = will make this more scaleable 🤞🏿

One issue I've just noticed though is that the results aren't consistent across multple runs e.g. Start nvim +PackerCompile then run lua require('packer').profile_output(). The values change if you repeat that instruction, not by a few milliseconds as you might expect but by quite a bit. I might be missing or doing something though.

Anyway this is still pending some syntax to make it a little nicer to read and maybe confirming the times are consistent.

@wbthomason
Copy link
Owner Author

Hmm, I am presumably doing something wrong, but following your example ("Start nvim +PackerCompile...profile_output()") produces no output for me. The profiling code is in packer_compiled, as expected, but no results are displayed and _G._packer.profile_output is nil.

@akinsho
Copy link
Collaborator

akinsho commented Apr 9, 2021

@wbthomason you need to set the enabled Boolean in your config or run PackerCompile profile=true

@wbthomason
Copy link
Owner Author

Right, I did that - hence the generation of the profiling code. Should there be a display with the results?

@akinsho
Copy link
Collaborator

akinsho commented Apr 9, 2021

So the full flow would be compile with profile true as you've done the run PackerProfileOutput I haven't added that command yet so you need to use the command lua require('packer').profile_output(). Although I wonder if I should just open that for the user except it would always open for users with it set to true in their config which would be annoying. Unless it only automatically opened the config if the user specified the true arg in the compile command

@akinsho
Copy link
Collaborator

akinsho commented Apr 9, 2021

Added some highlighting based on the size of the count any 3 digit ms counts are show as WarningMsg, medium as Float etc.

image

@akinsho
Copy link
Collaborator

akinsho commented Apr 9, 2021

packer_profile

Here's what I see but only when switching between profiling an not on the first run it's much faster and subsequent runs show what I think is the true time

lua/packer.lua Show resolved Hide resolved
@akinsho
Copy link
Collaborator

akinsho commented Apr 9, 2021

Ahhh I think it might relate to my use of nvim "+PackerCompile profile=true" etc. I think something about the timing of how that function executes is doing something odd. I tried it now just doing

  1. nvim -> then typing in PackerCompile profile=false
  2. Restart nvim try PackerProfile see expected warning
  3. nvim -> then typing PackerCompile profile=true
  4. Restart nvim try PackerCompile see expected results

@akinsho
Copy link
Collaborator

akinsho commented Apr 9, 2021

Ok I'm convinced now that it relates to how the quoted command works, when I run the compile with the flags in an already started neovim it works fine, think that's an edge case to investigate later if necessary maybe.

I've updated the docs as well so I think generally this fine, might be missing something. Think we can always iterate once it's out granted there are no lingering bugs or anything.

@wbthomason wbthomason marked this pull request as ready for review April 9, 2021 17:35
@wbthomason
Copy link
Owner Author

Cool, thanks. The only thing I think we still might want to consider before merging is whether we should always output the profiling code and conditionally enable it (as the current PR does) or conditionally output always enabled profiling code (e.g. if the profiling code imposes a significant slowdown on startup).

I'll try to run some tests on my setup tonight to see if there's a significant difference (with profiling disabled) between my startup time on this branch or master.

@akinsho
Copy link
Collaborator

akinsho commented Apr 9, 2021

I personally think it would be great to implement without the need to recompile. I find having to think about whether or not my compiled file is right or not unwieldy. Would be nice to remove that obstruction. But I get the need to be mindful of performance.

@wbthomason
Copy link
Owner Author

I agree, but since I'm already intending to move away from manual recompilation (by introducing the plugin manifest we talked about in #248 (comment) etc.), I'm slightly more OK with operations that require a recompile, as that'll be made automatic soon (I'm hoping to pull together a draft PR for the manifest + automatic recompilation this weekend, at least the start of those changes).

This could also reasonably be changed in a follow-up PR, but I'd like to see if it's even an issue first (i.e. if there's any significant overhead added).

@wbthomason
Copy link
Owner Author

....actually, just did some preliminary time sampling, and I'm seeing at most ~1ms overhead for profiling enabled (not even disabled but profiling present). If you can confirm that there's similarly basically no overhead on your end, I'm happy to merge as-is.

@akinsho
Copy link
Collaborator

akinsho commented Apr 9, 2021

Those changes sound interesting, and like a real quality of life improvement. Regarding the changes here, by merging as is, do you mean with the compiled profiling always being present since at the moment it isn't it or do you mean taking out the conditional compilation?

I was actually wondering idly, why technically does packer need a compiled file at all. Think I've missed some steps but most of the lazy loading is via fake commands, mappings and autocommands which can all be created on startup?

@wbthomason
Copy link
Owner Author

Those changes sound interesting, and like a real quality of life improvement. Regarding the changes here, by merging as is, do you mean with the compiled profiling always being present since at the moment it isn't it or do you mean taking out the conditional compilation?

Isn't the compiled profiling always present right now? I don't see a switch to e.g. make timed_chunk a nullop or not emit the save_profiles function. It's disabled if config.profile.enable = false, but timed_chunk still emits the extra calls to the timing functions (though LuaJIT presumably can optimize these away since the timing function is a nullop if profiling is disabled).

I was actually wondering idly, why technically does packer need a compiled file at all. Think I've missed some steps but most of the lazy loading is via fake commands, mappings and autocommands which can all be created on startup?

So, you're absolutely right that you can generate all of those on startup, and this is indeed what e.g. vim-plug does. However, this can cost some non-trivial time (on the order of a few ms, but still), so packer (and others, like dein: https://github.com/Shougo/dein.vim/blob/master/autoload/dein/util.vim#L269) pre-generates the commands that create these loaders in the right sequence, etc. As far as I'm aware, packer takes this further than dein, but it's the same idea in both.

Part of my motivation for designing packer this way is not only the immediate performance gain (which is admittedly slight in most instances), but the potential for applying more expensive optimizations at compile time - things like setting up the ordering for sequence loads, or potentially enumerating the files which need to be sourced for some plugin (to skip scanning directories on startup), etc. I also personally like being able to read the loading logic for my plugins - when I used plug, I would not infrequently run into issues with something not loading as I expected, but couldn't easily inspect what was going on to debug.

I think there's a fair argument that the compiled file has, for a solid chunk of users, been more trouble than it's worth so far. I think that once compilation no longer needs to be manual, though, this will change.

@akinsho
Copy link
Collaborator

akinsho commented Apr 9, 2021

@wbthomason thanks for the explanation sounds like solid reasoning, can definitely see the argument for decoupling optimisations to a compilation stage separate from the startup.

You're right re. The compiled timed functionality I guess it's just whether or not saving it is enabled or not which begs the question if we leave this in why bother with enabling or disabling it anyway. It's always running so a user can just decide to look at it or not. We can just skip all that complexity?

EDIT: to clarify my thoughts here a bit better I mean that basically we are already doing the work of profiling the only difference that adding this flag does is whether or not the output, which we've already got but not collated, gets saved to the global variable or not. In which case why bother with a config flag and arguments to compile if ultimately we are already always doing almost all the work. If a user doesn't want to see profile data then they just won't use PackerProfile otherwise it's always there.

@akinsho
Copy link
Collaborator

akinsho commented Apr 10, 2021

@wbthomason

....actually, just did some preliminary time sampling, and I'm seeing at most ~1ms overhead for profiling enabled (not even disabled but profiling present). If you can confirm that there's similarly basically no overhead on your end, I'm happy to merge as-is.

Just ran this with profiling enabled and disabled and measured using dstein/startuptime and not seeing any change over a ms in my startup time.

EDIT: it's worth noting that my startup time fluctuates quite a bit between runs of this plugin under normal circumstances anyway so it's hardly scientific 😆

@wbthomason
Copy link
Owner Author

Just ran this with profiling enabled and disabled and measured using dstein/startuptime and not seeing any change over a ms in my startup time.

Great, thanks! I want to make a couple of small tweaks (e.g. printing a helpful message if there's no profiling data), then I think we're OK to merge.

it's worth noting that my startup time fluctuates quite a bit between runs of this plugin under normal circumstances anyway so it's hardly scientific

Huh, this surprises me. My setup's startup time is quite stable (~1-2ms usually) under startuptime. Do you have nondeterministic parts of your config or something similar?

If a user doesn't want to see profile data then they just won't use PackerProfile otherwise it's always there.

Yeah, given that the overhead seems to be super minimal, I'm pretty OK with this. I'll push some changes to make this so.

@dagadbm
Copy link

dagadbm commented Apr 10, 2021 via email

@akinsho
Copy link
Collaborator

akinsho commented Apr 12, 2021

@dagadbm I don't think your startup time does depend on open buffers since it should normally be time till vim opens the first buffer according to :h --startuptime sourcing a session is something that isn't done by default so vim shouldn't normally open with a bunch of buffers. Unless vim is started with -S or a plugin sources the session file vim startup wouldn't include sessions

@dagadbm
Copy link

dagadbm commented Apr 12, 2021 via email

@wbthomason
Copy link
Owner Author

@dagadbm If this slowdown is packer-related, please file a new issue. I will say that (I think) previous sessions can affect startup time through the ShaDa file, but I don't think that this is affected by the particular buffers you had open.

@akinsho I tested the overhead of enabled profiling on another machine, and saw a ~10ms slowdown, which is pretty significant. I'm trying to think about how to enable/disable profiling without requiring a recompile to work around this, before merging.

@akinsho
Copy link
Collaborator

akinsho commented Apr 12, 2021

Wow @wbthomason that's much larger than I would have thought likely, was it an older machine? it's just checking the time for the most part and doing a very small loop 🤔 . Anyway if it might impact performance that much makes sense to see if there's a way to avoid that.

@wbthomason
Copy link
Owner Author

Not that old (a few years) - and this was measured between starting Neovim with profiling enabled and with profiling disabled. I should confirm that the slowdown wasn't some kind of fluke - I've as yet been unable to find a way to enable profiling without e.g. using an environment var or requiring a recompile.

@akinsho
Copy link
Collaborator

akinsho commented Apr 13, 2021

@wbthomason well since we are already in the recompilation track and that's what users know then I guess the solution would be to not compile in the timing code unless profile is set to true? Not sure how easy that will be to do but I if that's the path we have to go down I think it's fair enough to get this out in some form. Maybe it can be optimised later or your recompilation changes will make the compilation part less of of an overhead

@nogweii
Copy link

nogweii commented Apr 18, 2021

This works for me! I haven't noticed a significant performance impact on the startup time.

I decided to use this because I was wondering why my neovim was taking ~350ms to start. This PR pointed the way and resulted in kabouzeid/nvim-lspinstall#38 being created.

@akinsho
Copy link
Collaborator

akinsho commented Apr 18, 2021

That's awesome @nogweii was actually looking into that i.e. lspinstall as well using this PR but hadn't got round to doing anything, glad you were able to track that down and get it fixed 🚀 . @wbthomason I could push some changes to this to make timed_chunk a noop when profiling is disabled? that should reduce the overhead you saw on the other machine hopefully.

@wbthomason
Copy link
Owner Author

@akinsho The overhead is only there if we have profiling enabled always; we currently noop when it's disabled. I haven't been able to come up with a trick for enabling/disabling that doesn't use either a recompile or an environment variable, so I think we may just merge this for now and try to improve the ergonomics later. Does that sound reasonable?

Also @nogweii I'm glad to hear this is already being useful!

@akinsho
Copy link
Collaborator

akinsho commented Apr 19, 2021

🤦🏿‍♂️ yep forgot that it already is/was a noop if disabled in which case I think it's fine to merge as is. I think people can decide whether or not to use it if they are seeing an impact in startup time/ just want it temporarily and as you say the ergonomics can be improved over time 👍🏿

@wbthomason
Copy link
Owner Author

Sounds good to me. Thanks for all the help!

@wbthomason wbthomason merged commit 93f440d into master Apr 19, 2021
WIP features automation moved this from In progress to Done Apr 19, 2021
@akinsho akinsho deleted the feat-profile-compiled-code branch April 19, 2021 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants