《Disney +》 迪士尼、Marvel、彼思、星球大戰…  Nintendo Switch版「Apex英雄」即日起開放下載!你的SD記憶卡準備好了嗎?   名古屋也有電競旅館!?「GOLD STAY 名古屋 栄」電競專用三人高級客房登場!   奧丁將重返《刺客教條:維京紀元》史詩級資料片《諸神黃昏的預兆》   《Tribes of Midgard》:駕馭維京色彩鮮明的猛獸之道   PONOS推出新手遊《本当の幸せ》日本上線!冥想翱翔空中的奇妙動作遊戲!   那個超大作也發表了PS5版本!統整「State of Play」發表内容!   不用懷疑!電競吸管「Razer Reusable Straw」登場!   『快打旋風V』公布新角色「蘿絲」更新日期! 

Vim Profiling 抓出哪邊速度慢

商業

Vim 的外掛很多,裝太多會造成啟動變慢,或者某些時候變慢,要怎麼知道是哪個外掛造成的?或者是哪個 Function 造成速度慢的呢?

Vim Profiling 抓出哪邊速度慢

沒想到 Vim Profiling 的工具光內建就一卡車可以使用,而且各種分析都有~

以下來列 Vim Profiling 的各種作法

  • vim --startuptime vim.log # 離開 Vim 後,查看 vim.log 的檔案,可以看到各個檔案外掛所消耗的時間
  • vim # 於 Vim 內,使用 : 的命令如下:
    1. :profile start profile.log
    2. :profile func
    3. :profile file
    4. " At this point do slow actions
    5. :profile pause
    6. :noautocmd qall!
    7. # 查看 profile.log 會看到 function 每個花的時間
  • vim -V12log # 離開 Vim 後,查看 log 這個檔案內容,會有執行哪些東西
  • vim --cmd 'profile start profile.log'
    --cmd 'profile func '
    --cmd 'profile file '
    -c 'profdel func '
    -c 'profdel file '
    -c 'qa!' # 把所有歷程的 function 都印出來

相關網頁

Tsung

隨機商業新聞

NordVPN