Loading ...
Sorry, an error occurred while loading the content.

Re: using cmd+n to create new window is "slow"

Expand Messages
  • Nico Weber
    Hi, ... if you re using Leopard, you can use dtrace to get an idea. Example: $ cat file_activity.d #!/usr/sbin/dtrace -s #pragma D option quiet
    Message 1 of 4 , May 22, 2008
    View Source
    • 0 Attachment
      Hi,

      > Thanks for the quick response. I tried to see if removing my .vim
      > directory would make a difference, and it did not. Is there anyway for
      > me to see exactly _what_ is taking so much time?

      if you're using Leopard, you can use dtrace to get an idea. Example:

      $ cat file_activity.d
      #!/usr/sbin/dtrace -s

      #pragma D option quiet

      syscall::open*:entry
      / execname == "Vim" /
      {
      printf("%s %s %Y\n", execname, copyinstr(arg0), walltimestamp);
      }
      $ sudo dtrace -s file_activity.d

      Now open MacVim, then return to Terminal.app and hit Ctrl-c to stop
      dtrace. You'll now have a list of files Vim opened while starting,
      together with timestamps when they were opened ("%Y" gives you only a
      resolution of a second. You can get much better time resolution if you
      print the timestamp as a long long via "%d", but it's less readable).

      Example output on my system:

      Vim . 2008 May 22 11:10:27
      Vim /System/Library/Frameworks/Python.framework/Versions/2.3/
      Python 2008 May 22 11:10:28
      Vim /usr/lib/libruby.1.dylib 2008 May 22 11:10:28
      Vim /dev/dtracehelper 2008 May 22 11:10:28
      Vim /dev/urandom 2008 May 22 11:10:28
      Vim /dev/autofs_nowait 2008 May 22 11:10:28
      Vim /usr/share/locale/de_DE.UTF-8/LC_COLLATE 2008 May 22 11:10:28
      ...
      Vim /Users/nico/.vim/plugin/ 2008 May 22 11:10:28
      Vim /Users/nico/.vim/plugin/ 2008 May 22 11:10:28
      Vim /Users/nico/.vim/plugin/a.vim/ 2008 May 22 11:10:28
      Vim /Users/nico/.vim/plugin/a.vim/ 2008 May 22 11:10:28
      Vim /Users/nico/.vim/plugin/bufexplorer.vim/ 2008 May 22 11:10:28
      Vim /Users/nico/.vim/plugin/bufexplorer.vim/ 2008 May 22 11:10:28
      Vim /Users/nico/.vim/plugin/NERD_commenter.vim/ 2008 May 22
      11:10:28
      Vim /Users/nico/.vim/plugin/NERD_commenter.vim/ 2008 May 22
      11:10:28
      ...
      Vim /Users/nico/.gvimrc 2008 May 22 11:10:28
      Vim /Users/nico/_gvimrc 2008 May 22 11:10:28
      Vim . 2008 May 22 11:10:28
      Vim . 2008 May 22 11:10:28
      Vim /Users/nico/src/vim/MacVim/src/MacVim/config/environment.rb
      2008 May 22 11:10:28
      Vim /var/folders/c3/c36w8uFSFFe6mwtmMOP7FU+++TI/-Caches-/
      com.apple.IntlDataCache.le.sbdl 2008 May 22 11:10:28
      Vim /System/Library/CoreServices/Encodings/
      libJapaneseConverter.dylib 2008 May 22 11:10:28
      Vim /Users/nico/.viminfo 2008 May 22 11:10:28

      (lots of output omitted).

      You could extend the dtrace script to also trace when a file is closed
      and several other things. dtrace is a very powerful tool, you can
      learn more on http://docs.sun.com/app/docs/doc/817-6223 . You can also
      check `:e $VIMRUNTIME/syntax/dtrace.vim` for a short overview of built-
      in variables etc.

      If you decide to investigate, please share your results on this list :-)

      Nico

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.