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

[RFC] vim-patch:7.4.2017,7.4.2018,7.4.2021,7.4.2022,7.4.2023,7.4.2024 #5913

Merged
merged 8 commits into from Feb 6, 2017

Conversation

mhinz
Copy link
Member

@mhinz mhinz commented Jan 8, 2017

  • 7.4.2017
  • 7.4.2018
  • 7.4.2021
  • 7.4.2022 (not really bufref-related, but a very small patch and not yet merged)
  • 7.4.2023
  • 7.4.2024

vim-patch:7.4.2017

Problem:  When there are many errors adding them to the quickfix list takes
          a long time.
Solution: Add BLN_NOOPT.  Don't call buf_valid() in buf_copy_options().
          Remember the last file name used.  When going through the buffer
          list start from the end of the list.  Only call buf_valid() when
          autocommands were executed.

vim-patch:7.4.2018

Problem:  buf_valid() can be slow when there are many buffers.
Solution: Add bufref_valid(), only go through the buffer list
          when a buffer was freed.

vim-patch:7.4.2021

Problem:  Still too many buf_valid() calls.
Solution: Make au_new_curbuf a bufref.  Use bufref_valid() in more places.

vim-patch:7.4.2022

Problem:  Warnings from 64 bit compiler.
Solution: Add type casts. (Mike Williams)

vim-patch:7.4.2023

Problem:  buflist_findname_stat() may find a dummy buffer.
Solution: Set the BF_DUMMY flag after loading a dummy buffer.  Start
          finding buffers from the end of the list.

vim-patch:7.4.2024

Problem:  More buf_valid() calls can be optimized.
Solution: Use bufref_valid() instead.

@mhinz mhinz changed the title [RFC] vim-patch:7.4.2017,7.4.218 [WIP] vim-patch:7.4.2017,7.4.218 Jan 8, 2017
@justinmk
Copy link
Member

justinmk commented Jan 8, 2017

Oops, I thought we already had merged these, which is why I closed #1776. A fun way to test this is:

:grep -r . *

CTRL-C after ~2 seconds, then it takes a few seconds to fill the quickfix list with 500000 entries.

Note that before #5396 the bottleneck was the UI spam. Now after #5396 we're actually faster than Vim (except adding to the quickfix list is slow, until this PR is merged).

@mhinz mhinz force-pushed the buf-lookup-patches branch 2 times, most recently from 8e1a89c to 3f196af Compare January 8, 2017 16:52
@marvim marvim added the WIP label Jan 8, 2017
@mhinz mhinz changed the title [WIP] vim-patch:7.4.2017,7.4.218 [WIP] vim-patch:7.4.2017,7.4.2018,7.4.2021,7.4.2022,7.4.2023,7.4.2024 Jan 9, 2017
@mhinz mhinz force-pushed the buf-lookup-patches branch 3 times, most recently from 243cf30 to 921c4e1 Compare January 9, 2017 11:20
@mhinz mhinz changed the title [WIP] vim-patch:7.4.2017,7.4.2018,7.4.2021,7.4.2022,7.4.2023,7.4.2024 [WIP] vim-patch:7.4.2017,7.4.2018,7.4.2021,7.4.2022,7.4.2023,7.4.2024,7.4.2036 Jan 9, 2017
@mhinz mhinz force-pushed the buf-lookup-patches branch 2 times, most recently from 80fb012 to 19f76b9 Compare January 9, 2017 19:50
@mhinz mhinz changed the title [WIP] vim-patch:7.4.2017,7.4.2018,7.4.2021,7.4.2022,7.4.2023,7.4.2024,7.4.2036 [WIP] vim-patch:7.4.2017,7.4.2018,7.4.2021,7.4.2022,7.4.2023,7.4.2024 Jan 9, 2017
@mhinz mhinz changed the title [WIP] vim-patch:7.4.2017,7.4.2018,7.4.2021,7.4.2022,7.4.2023,7.4.2024 [RFC] vim-patch:7.4.2017,7.4.2018,7.4.2021,7.4.2022,7.4.2023,7.4.2024 Jan 9, 2017
@marvim marvim added RFC and removed WIP labels Jan 9, 2017
@mhinz
Copy link
Member Author

mhinz commented Jan 10, 2017

BTW, the failing clint job is expected for these two lines:

src/nvim/globals.h:606:  for should always use braces  [readability/braces] [5]
src/nvim/globals.h:608:  for should always use braces  [readability/braces] [5]

@jamessan
Copy link
Member

If you rebase, you'll get a couple more clint errors that should be fixed. :)

@mhinz
Copy link
Member Author

mhinz commented Jan 10, 2017

@jamessan Thanks for the heads-up!

@jamessan
Copy link
Member

jamessan commented Feb 1, 2017

Once you rebase, I'll take a look at this.

BLN_CURBUF = 1, // May re-use curbuf for new buffer
BLN_LISTED = 2, // Put new buffer in buffer list
BLN_DUMMY = 4, // Allocating dummy buffer
// TODO(mhinz): merge patch that introduces BLN_NEW
Copy link
Member

Choose a reason for hiding this comment

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

This was 7.4.1858.

Copy link
Member Author

@mhinz mhinz Feb 5, 2017

Choose a reason for hiding this comment

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

Ah, okay. It's not important for this PR, though. Just thought I leave a note so people don't wonder why we jumped from 4 to 16.

Problem:  When there are many errors adding them to the quickfix list takes
          a long time.
Solution: Add BLN_NOOPT.  Don't call buf_valid() in buf_copy_options().
          Remember the last file name used.  When going through the buffer
          list start from the end of the list.  Only call buf_valid() when
          autocommands were executed.

vim/vim@8240433
Problem:  buf_valid() can be slow when there are many buffers.
Solution: Add bufref_valid(), only go through the buffer list
          when a buffer was freed.

vim/vim@b25f9a9
Problem:  Still too many buf_valid() calls.
Solution: Make au_new_curbuf a bufref.  Use bufref_valid() in more places.

vim/vim@19ff9bf
Problem:  Warnings from 64 bit compiler.
Solution: Add type casts. (Mike Williams)

vim/vim@25065ec
Problem:  buflist_findname_stat() may find a dummy buffer.
Solution: Set the BF_DUMMY flag after loading a dummy buffer. Start
          finding buffers from the end of the list.

NOTE: In Neovim, buflist_findname_stat() was replaced by
buflist_findname_file_id() in c41535d.

vim/vim@ea3f2e7
Problem:  More buf_valid() calls can be optimized.
Solution: Use bufref_valid() instead.

NOTE: Some changes related to channels and the Python and Netbeans interfaces
were obviously left out.

vim/vim@7c0a2f3
v7.4.2024 changed a few function signatures of functions that we use in
Neovim-specific code, e.g. the API.

Due to that the commit for 7.4.2024 doesn't build on its own, only together with
this commit.
@jamessan jamessan merged commit 11efbc8 into neovim:master Feb 6, 2017
@jszakmeister jszakmeister removed the RFC label Feb 6, 2017
@mhinz
Copy link
Member Author

mhinz commented Feb 7, 2017

@jamessan Thanks for review and merging.

@mhinz mhinz deleted the buf-lookup-patches branch February 7, 2017 15:23
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.

None yet

5 participants