Skip to content

vital モジュールのロードを爆速にする & ロード方法を考える #415

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

Merged
merged 83 commits into from
Apr 29, 2016

Conversation

haya14busa
Copy link
Member

概要

使い方

  1. :Vitalize . でアップデートしたり新たに :Vitalize
  2. vital#of({plugin-name}) の変わりに vital#{plugin-name}#of() を使う

これだけ!
ただ,vital#of({plugin-name})でも速くなるようにしています. except vital#of('vital')

現時点で既に対応しているプラグイン

ベンチマーク

TODO

注意点

vital#of をどうするか?

  1. vital#of({plugin-name}) はそのままで,速くしたい場合は vital#{plugin-name}#of()を導入
  2. vital#of({plugin-name}) のインターフェースはそのままで内部で早くする.vital#{plugin-name}#of()は導入しない
  3. vital#of({plugin-name}) のインターフェースはそのままで内部で早くする.vital#{plugin-name}#of()も導入する
  4. vital#of({plugin-name}) は組み込まず vital#{plugin-name}#of()に完全移行
    • 厳密にはvital#of('vital')相当は残す or 別の対応する機構を提供
  5. そもそもvitalのローダ作る必要なくね? vital#{plugin-name}#import({module-name}) とかに移行する.

などなどがあります

あと少なくとも新しいvitalオブジェクトでは s:V.search(), s:V.load(), s:V.exists() とか別にいらないんじゃないかと思うみたいな思いもあります

疲れたのであとは随時追記するかコメントします

@haya14busa
Copy link
Member Author

@tyru
Copy link
Member

tyru commented Mar 24, 2016

関連 #40 #41

@rhysd
Copy link
Contributor

rhysd commented Mar 24, 2016

関連記事:

http://haya14busa.com/revital-vim-makes-vital-vim-a-lot-faster/

速くなるのは間違いないと思うので入れる方向で行きたいです.

@haya14busa
Copy link
Member Author

冒頭コメントちょっとアップデートした.

@haya14busa
Copy link
Member Author

このへんに記事に対しての thinca さんのコメント http://lingr.com/room/vim/archives/2016/03/23#message-23153686

@haya14busa
Copy link
Member Author

revital で落ちてなかったのに落ちてるのはナンデや(古いvim)...まぁまた対応します

@thinca
Copy link
Member

thinca commented Mar 24, 2016

インストールされる各モジュールを書き換えることは、モジュールの製作者が予期しない副作用が発生する可能性があるので消極的です。(絶対ダメとは言っていない)

@haya14busa
Copy link
Member Author

はい,まぁそれがわかってるから最初は別リポジトリにしたんですが流れ的に行けるかなと(流れ力)

@haya14busa
Copy link
Member Author

s:___vital_function___ 以外はスクリプト変数も関数も汚してないですが,まぁ逆に言うとひとつは汚してはいる

@haya14busa
Copy link
Member Author

thincaさんが前に言っていたようなsidのみ返す関数にしても同様にスクリプト変数1つ,またはスクリプト関数1つ定義しなきゃだめですね

@thinca
Copy link
Member

thinca commented Mar 24, 2016

あーあと使用するローダーを :Vitalize のオプションで指定できるようにして、新版は明示的に指定した時のみ使うようにすると良いかも。移行期間的な。gcc の -std=c++14 的な感じで(ちょっと違うけど)。
ただめっちゃ面倒そうなので、どうしても面倒ならそれもやむなし。

@haya14busa
Copy link
Member Author

選択はたしかに有りな気はしますね

@haya14busa
Copy link
Member Author

s:___vital_function___ 以外はスクリプト変数も関数も汚してないですが,まぁ逆に言うとひとつは汚してはいる

これ 7.3.1170 以降は消せるので,:Vitalize 時にプラグインが7.3.1170以前に対応するかどうか決めれるみたいなのはやるといいかも

@haya14busa
Copy link
Member Author

これ 7.3.1170 以降は消せるので,:Vitalize 時にプラグインが7.3.1170以前に対応するかどうか決めれるみたいなのはやるといいかも

冷静に考えると :Vitalizer で指定とかなしで対応できるな

@haya14busa
Copy link
Member Author

execute 使うけどスクリプト変数もスクリプト関数も残さないようにした.便利.
テストの落ち方が謎でつらい

@ujihisa
Copy link
Member

ujihisa commented Mar 25, 2016

APIについて (実装は無視):

これまでvital#of("aaa")みたいにof()という関数を提供してたのはconstructor fuctoryとしてほとんど無名にしたかったための命名でした。今回vital#aaa#of()みたいにユーザプラギン名が文字列でない形ででてくるなら、実装が可能ならofすらとってしまってvital#aaa()みたいにするとより便利さ。(実装上うまく安全に混ぜることができないならスルー力で)

@rhysd
Copy link
Contributor

rhysd commented Mar 26, 2016

vital#aaa だとファイルをプラギンごとに分けられないと思います.ただ,確かに vital#plugin#of は微妙ですね…

@haya14busa
Copy link
Member Author

vital#pluginname() は無理ですね.

ただ,確かに vital#plugin#of は微妙ですね…

vital#pluginname() は無理となったら結局 vital#pluginname#{無名にちかいconstruct関数名} にしなきゃだめで vital#of() の議論と同じになるのではないでしょうか?

インターフェース追加して vital#pluginname#import() とかはありかなとかは考えてますが, vital#of()相当は残したほうが移行もスムーズにできるし便利そう.

@haya14busa haya14busa force-pushed the revital branch 3 times, most recently from 09e87d4 to 379dacb Compare March 26, 2016 02:38
@haya14busa
Copy link
Member Author

はい.あってます.appveyor の vim7.3 build でヨクワカラナイエラーが出ることを本当は修正したい...原因究明したい...という以外は何もやることは残ってないはずです.

ただテスト通っているのは別のテストをスキップしてたので対象の vital.vimspec をスキップするように修正しました.

@haya14busa
Copy link
Member Author

厳密にこのPRのheadではなくなってる気もするけど, incsearch.vimやeasymotoinでは前からこのPRをmasterで試していて,今の所おかしくなったというissueはないです.

@Shougo
Copy link
Member

Shougo commented Apr 25, 2016

unite.vim, neocomplete 等で使用していますが、特に問題はないです。

@ujihisa
Copy link
Member

ujihisa commented Apr 25, 2016

マージ & ブログ記事たのしみです!

@tyru
Copy link
Member

tyru commented Apr 26, 2016

Windows on Vim 7.3 で動かない件は Changes に書いておく必要はありそうですね。
ただもう Vim 7.3 を使う人も少なくなってきてるような気はするので、思った程問題ないような気もします。

  • Vim プラグイン開発者に求めること:Windows on Vim 7.3 では現状動かない事を理解した上で vital を使ってもらう
  • このPRで行うこと (Windows on Vim 7.3 で動かない件に対して)

自分はこの件に関してこれで十分と感じてるんですが、皆さんはどうでしょうか?

@haya14busa
Copy link
Member Author

haya14busa commented Apr 26, 2016

Windows on Vim 7.3 で動かない件は Changes に書いておく必要はありそうですね。
ただもう Vim 7.3 を使う人も少なくなってきてるような気はするので、思った程問題ないような気もします。

実はそれよりももっと条件は狭まっていて,

  1. すくなくとも起こるとしても :Vitalize時関連.(またはテスト)
  2. 他のテスト(System.Process.Vimproc)をskipしたりすると通ることから,普通に:Vitalizeする分にはVim 7.3 on Windowsだろうが動く
  3. このPRでバグが入ったわけではなく,そもそもmasterのvitalでもテストのみ移植すると再現する

という感じです.

なので Changes に書くようなことではないかな.
丁寧にやるなら issue 作成プラスknown issue としてdocに書くくらいでしょうか.

@haya14busa
Copy link
Member Author

なので

Vim プラグイン開発者に求めること:Windows on Vim 7.3 では現状動かない事を理解した上で vital を使ってもらう

これは言い過ぎで,Windows on Vim 7.3 で:Vitalizeする際に特定の条件で失敗する可能性がある.というだけなはずです.
プラグインを使うユーザに関しては関係ないはず.

@tyru
Copy link
Member

tyru commented Apr 26, 2016

あー vitalizer の話だったんですね。それじゃ Changes に書かなくても良さそうですね。

haya14busa added a commit to haya14busa/vim-operator-flashy that referenced this pull request Apr 26, 2016
function! s:install_module_files(module_files, plugin_name, to) abort
" List and check the installing module_files.
let install_files = []
" for f in files + s:LOADER_FILES
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメントアウトのこってたので後で消します

@tyru
Copy link
Member

tyru commented Apr 27, 2016

あとこのタスクもありました (上のタスクリスト更新)。

さすがに既存のhelpのvital#of('vital')修正して回る作業をここでするとdiffが死ぬので別で

上ではドキュメントの修正もタスクとして上げちゃいましたが、こういったドキュメントの修正であれば自分がGWに別PRでやるので、 @haya14busa さんがもう修正の予定がないならマージしても良いと自分は思います。 :shipit:

@thinca
Copy link
Member

thinca commented Apr 29, 2016

@haya14busa マージしちゃっても良いかな?

@haya14busa
Copy link
Member Author

👍👍👍👍👍

@haya14busa
Copy link
Member Author

haya14busa commented Apr 29, 2016

vital#of() -> vital#vital#of のドキュメント修正は単にdiff増やしたくなかっただけで grep からの qfreplaceで多分しゅっと直せるけど,やっていただけるなら任せちゃおうかな?

あと,test で呼ばれてる vital#of() も vital#vital#of() にかえれそう

@thinca thinca merged commit 30b51b8 into vim-jp:master Apr 29, 2016
@haya14busa
Copy link
Member Author

マッジありがとうございますっ ✨ ✨ ✨

@haya14busa haya14busa deleted the revital branch April 29, 2016 09:02
tyru added a commit to tyru/open-browser.vim that referenced this pull request May 1, 2016
tungel added a commit to tungel/.vim that referenced this pull request May 12, 2016
5c6f3cd update vital
a6b3c10 Merge pull request #285 from easymotion/rerevitalize
02884f8 Try vim-jp/vital.vim#415
2dad1b1 Merge pull request #282 from easymotion/revitalizer
07e3665 Update vital
cdc77ad introduce revitalizer for speed!!!

git-subtree-dir: bundle/vim-easymotion
git-subtree-split: 5c6f3cd9a713491e6b32752a05c45198aa91540a
NonWonderDog added a commit to NonWonderDog/.vim that referenced this pull request May 19, 2016
e2bfabf Merge pull request #87 from tyru/upgrade-vital
5f8d5e7 Upgrade to new vital (vim-jp/vital.vim#415)
5170a17 Merge pull request #85 from tyru/fix/cant-open-filepath
ab2a06a Fix: can't open filepath
6cb4bd3 Update *openbrowser-thanks*
9aefebf Merge pull request #83 from tyru/vim-jp-redirects
85338d9 [AppVeyor] Use vim-jp.org/redirects
505e21c Use suite.after_each(), don't :catch
64f4cad Doc: Update g:openbrowser_no_default_menus description
2db88f0 Add menu on GUIEnter
3fa43a6 Use <Nop> for menu-separator
8a11108 Don't map Select-mode
62c3d27 Cosmetic fix
db04dcc Use :menutrans
41f64e0 g:restart_no_default_menus: Respect &guioptions =~# 'M'
8b342c9 ':OpenBrowser' won't open 'http://203.0.113.11' (Fix #82)
6a8eb25 Add appveyor.yml
c056913 Update README.md
910cd8b Fix test for AppVeyor
cfc0743 Create README.md
881195a Update .travis.yml
e2e57f4 Add tests for MS Windows
b05377d oops s/themis#suite/themis#helper/
c28b2da Add tests with some refactorings
2456f74 Write basic test (only for Linux)
4deae48 Update help
fde2c45 (Fix #81) ':OpenBrowserSmartSearch tyru/open-browser.vim' fails
15e9b3f Make open-browser.vim testable (#1)
fcbdcc9 Merge pull request #80 from anekos/fix/allow-the-url-without-dots
8123820 Allow the url without dots
a1894bc Add .travis.yml
0476982 Fix: infinite loop bug
122f365 Fix: ':OpenBrowserSmartSearch foo bar' throws an error
e4d528a Fix warnings/errors found by vimlint
2ec2875 Improve URL detection
b0326dc Fix <Plug> keymappings tags
61169d9 Small refactoring
f2c50a3 Update vital
616949c Refactoring
39b0190 Fix s:Web.URI._eat_em(): empty string is not 'no match' (#72)
658993b More tolerant URI parsing (#72, #73, #74)
6072647 Fix comments
5dc8916 Merge pull request #74 from rhysd/patch-1
d9983a1 :OpenBrowser should open file with browser by default
e175358 Fix: #71 change broke #70
ce1a1dc More torrelant behavior when there are no words on cursor (#71)
10ee02c Fix deprecation warnings (#70)
f8ca30b Open multiple URLs when selecting in visual-mode (#70)

git-subtree-dir: bundle/open-browser
git-subtree-split: e2bfabfc758351ee3087d4c697d1953660d943ee
pbrinkmann added a commit to pbrinkmann/dotfiles that referenced this pull request Feb 12, 2023
b3cfab2a Merge pull request #458 from oflisback/master
7e67d5ee Merge pull request #454 from C-Fergus/master
c199aa71 Update README.md
3d8c6377 Fix link to tutorial
1f3e72aa Add Vim-Plug and Vim8 Native installation help
d75d9591 Merge pull request #440 from jakelinnzy/master
2cee2ad2 Add documentation
0eeed154 Fix 'No matching autocommands' warning
41bbb8ce Merge pull request #439 from easymotion/revert-437-jakelinzy
9e80b064 Revert "Add autocommands to notice linters"
96f1d4a6 Merge pull request #437 from jakelinzy/jakelinzy
e50e171b Add entry in table of contents
4b7e7d22 Add autocmd on buffer content change
6c9c0547 Merge pull request #432 from adrian5/master
67ff04de Fix typo in doc
dd7b4b52 Merge pull request #418 from easymotion/langtool
46542183 fix more grammar errors
691a1247 fix languagetool runner setup
f00efd59 fix grammer
8c76d212 Introduce reviewdog/action-languagetool@v1
9194ce92 Merge pull request #416 from kazukazuinaina/update_travis_yml
14301e0d add more vim version in test
d534ba0d Merge pull request #415 from easymotion/reviewdog-badge
be9be0e2 Add reviewdog badge
aaa9addc Merge pull request #414 from easymotion/fix-ci
87a3a5d0 use github-pr-check for pull requests
89afcca6 introduce reviewdog/action-vint@v1
83a09a19 Add FUNDING.yml
d14eef2a Merge pull request #413 from hitsuji-no-shippo/fix-typo
e8b7e4ab docs(doc): fix typo in <Plug>(easymotion-bd-E)
85e90c97 Merge pull request #389 from cht8687/master
c7891515 fix typo and wording issue in README.md
1a0244c9 Merge pull request #374 from easymotion/reviewdog
d3b26777 CI: run vint with reviewdog
342549e7 Merge pull request #352 from trayo/patch-1
76f0251c Merge pull request #353 from trayo/patch-2
ffbc1780 fix typo
38a9bcad fix typo
e4d71c7b Merge pull request #341 from easymotion/fix-undo
3f844bcf fix undo restore failing when empty undo history
d55e7bf5 Merge branch 'feature/ascii-migemo'
1ca831d2 Support using migemo and smartsign feature at the same time
f916d602 Merge pull request #325 from kmorihiro/fix/migemodict
bd03c22f Fix to use current &migemodict value if it exists
450f1452 Support all ASCII characters in migemo, without whitespace.
ef386352 Fix to use migemodict for +migemo
19d00afe 📝 add incsearch-easymotion link
af9786ee add silent to :doautocmd
a84412c6 Merge pull request #314 from easymotion/fix-doautocmd
aa79397f update vital
0adc9b46 fix :doautocmd usage
20e5b052 📝 note EasyMotionIncSearch
11632455 update vital
5c6f3cd9 update vital
a6b3c10b Merge pull request #285 from easymotion/rerevitalize
02884f87 Try vim-jp/vital.vim#415
2dad1b16 Merge pull request #282 from easymotion/revitalizer
07e3665d Update vital
cdc77add introduce revitalizer for speed!!!
649120e9 Merge pull request #276 from YggdrasiI/master
33f141c3 Cursor highlight doesn't exist for some environment
fccf990d Remove local prefix 'l:' from let assignments.
d9c33fdd Remove option g:EasyMotion_maximal_jumpmarks.
e790e958 Remove comments with previous regexes.
c7a7f045 Merge branch 'master' into change_keyword_motions
8a4f00b3 -Update regex in EasyMotion#WBW  ('W' and 'B' movement) -Update regex in EasyMotion#EW ('E' and 'gE' movement) - Add global option EasyMotion_maximal_jumpmarks.  It limits the number of jump targets for the motion. If the search  goes in both directions, they will be handled separately.  The option was just added to speed up the automated tests in t/compare_movements_spec.vim.
d8b4a60a Update vital and fix inappropriate syntax reset
37042d34 - Change EasyMotion#WBK regex. Should now matches the default Vim motions b/w. - Add test to compare different motion algorithm. (WIP. Test trigger   undetectable vim-vspec error)
b1acf671 Init with overwin motions
799491e0 Fix #237
d0054091 Merge pull request #266 from modal/master
f209d824 Correct minor mispelling ovrewin should be overwin
e7779165 Make sure canceling easymotion with <C-c> fix #237
fc056f37 fix empty input
fc7d1d9a Make sure the autocmd event exists before doautocmd
65ee835a Merge branch 'experiment-preserve-syntax'
74fc979f IndentLine handlings
f5ecb99a From patch 7.4.792, we can conceal item with matchadd()
f80929ac overwin motions now see EasyMotion_do_shade option
d157c4d1 Avoid side-effect of calling s:findMotion() in EasyMotion#OverwinF()
87e7b88b Preserve syntax and support g:EasyMotion_do_shade for overwin motions
aaa9a4ab Preserve syntax
6bad3f41 Manage WinLeave/WinEnter events
65cde0b6 Update minimal configuration example to use overwin motions
f6e67b3e Fix typo
fb1f6587 Update README 📝
c97e03dc Bump up version to 3.0
291d92be Merge branch 'overwin' #130
c3d7bae2 Add document for overwin motions
7578ffe4 Support jump to first target feature for overwin motions
69753395 Add document for overwin motions
019fc00c Fix jump back to original view fix #210
c646db0f Merge branch 'fix-over-remapping'
d4c14f77 Fix remapping over commandline keymappings
c9cc9ecd Merge pull request #241 from somini/master
0ed4621f Merge branch 'fix-vcol'
f306da39 Fix <Tab> character handling for JK motions
656f3425 Update vital-hit-hint-motion
00fc3281 Now, you can move cursor even over/across window
39abbf30 Happy New Year!
2d2dfa76 Initial tests
a258f4b4 Keep undocumented ignore_exception option
dd27cd62 Add Documentation
8b0bec61 Better Throw behaviour
e3ee8c96 Extend verbose option to the command-line
59347916 Introduce verbose option
a21d4474 Merge pull request #251 from lhassan18/master
2073db00 Proofread
0806257c Merge pull request #240 from TrevorS/patch-2
64da9884 fix set hlsearch with g:EasyMotion_add_search_history == 0
67c6b91d Typo colum -> column.
eab003a0 Merge pull request #238 from arsenerei/patch-1
93bba698 Correct spelling
2a2cf14b fix Vim hangs for fold lines fix #235
30e6870f Raise priority for target highlight
cfcafd7a Use organization url for travis badge
b11864a4 update vital
15fc017e fix spec for bi-directional t motion
b10ed8fc Add experimental API called EasyMotion#go()
b6861684 Additional config and more intuitive target marge
ef0cb2b0 Merge pull request #232 from rhysd/organization
bbae7863 organization URL
50110091 Merge pull request #230 from azdkj532/master
d37e94d7 Add explantion of EasyMotionMoveHL
9f1c449e Merge pull request #221 from Vadskye/master
d3538d46 remove l: prefix
90307a6d use correct fnc for LineAnywhere mappings
c2011d43 fix respect_direction inconsistent naming
2ddc7345 add Search special case in mapping helper function
4465876c fix Next, Previous motions
9d7069e7 use mapping helper function for almost all mappings

git-subtree-dir: vim/bundle/vim-easymotion
git-subtree-split: b3cfab2a6302b3b39f53d9fd2cd997e1127d7878
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants