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

Add forerunner job status sign and a delay timer for running maple #184

Merged
merged 4 commits into from
Dec 29, 2019

Conversation

liuchengxu
Copy link
Owner

@liuchengxu liuchengxu commented Dec 28, 2019

  • Add the forerunner job status sign:

    • !files: the forerunner job is not finished yet. If you type something rightnow, the result is incomplete and uncertain.

    • *files: the forerunner job is done, now the responose of vim-clap should be fast and deterministic.

    The forerunner job is normally super fast and imperceptible unless you have 1 million items, in which case it may take seconds but Vim/NeoVim is still well responsive and you won't feel any typing lag.

  • Add the delay for running maple.

clap-fix-perf

I proposed serveral solutions for the perfornce improvement in #140. Although I have not tried all of them, the maple extension written in Rust already works very well. If you want to a performant vim-clap, please install Rust and then run :call clap#helper#build_all() in Vim/NeoVim.

Close #140.

@liuchengxu liuchengxu mentioned this pull request Dec 28, 2019
@liuchengxu liuchengxu changed the title Add forerunnet job status sign and a delay timer for running maple Add forerunner job status sign and a delay timer for running maple Dec 28, 2019
@liuchengxu liuchengxu merged commit 3f0d00c into master Dec 29, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix-perf branch December 29, 2019 03:15
@ImmemorConsultrixContrarie
Copy link
Contributor

I should say, all this flickering looks just bad. Maybe text field should be cleared by new results, not just wiped at the time user changes input? Because that doesn't look as bad as gif in this PR.

Also, this may be more perceptible and smooth if results would be shown line by line with very short delay, not just dropped on the screen all at once. Though I'm not quite sure about it.

@liuchengxu
Copy link
Owner Author

The redraw is caused by the job inherently to my knowledge, not the rendering strategy used by vim-clap. Rendering the content linewise does not help.

:Clap blines in this gif does not use the async job, but the built-in filter which is sync, so it does not have the redraw issue.

@liuchengxu
Copy link
Owner Author

Hmm, I just tried not clearing the previous content anyway, which seems to help indeed. Can you also check it out, see if it's really helpful? @ImmemorConsultrixContrarie

diff --git a/autoload/clap/impl.vim b/autoload/clap/impl.vim
index ec5c2cd..092a389 100644
--- a/autoload/clap/impl.vim
+++ b/autoload/clap/impl.vim
@@ -201,7 +201,7 @@ function! s:on_typed_async_impl() abort
     return
   endif
 
-  call g:clap.display.clear()
+  " call g:clap.display.clear()
 
   let cmd = g:clap.provider.source_async_or_default()

@ImmemorConsultrixContrarie
Copy link
Contributor

Hmm, I just tried not clearing the previous content anyway, which seems to help indeed. Can you also check it out, see if it's really helpful?

Err... No. I don't use either vim or vim-clap. I just write code blindly, heh.

@liuchengxu
Copy link
Owner Author

I just write code blindly

I actually very admire this..., I can't live without these tools.

Anyway I have confirmed that not clearing the outdated result immedidately indeed avoids the visual flicker. Thank you! @ImmemorConsultrixContrarie

@liuchengxu liuchengxu mentioned this pull request Dec 29, 2019
2 tasks
liuchengxu pushed a commit that referenced this pull request Aug 17, 2021
* Create FIAT-on-off-ramp.md

* Update FIAT-on-off-ramp.md

* Rename FIAT-on-off-ramp.md to FIAT-on-off-ramp-milestone-1.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance profile
2 participants