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

Minor bug? VimwikiDiaryPrevDay and VimwikiDiaryNextDay are *slow* #328

Closed
llinfeng opened this issue Apr 11, 2017 · 8 comments
Closed

Minor bug? VimwikiDiaryPrevDay and VimwikiDiaryNextDay are *slow* #328

llinfeng opened this issue Apr 11, 2017 · 8 comments

Comments

@llinfeng
Copy link

In general, issuing the two commands (:VimwikiDiaryNextDay and :VimwikiDiaryPrevDay) are slow on my side. It is in particular noticeable if I am using it on a desktop computer running HDD drive; and still noticeable when I am using it on M.2 SSD drive.

Just now, my Gvim session had crashed when I tried to go to the journal/diary a day before, leaving the following "trace" as caught by Dr. Mingw.

gvim.exe caused an Access Violation at location 74C59584 in module msvcrt.dll

gvim.exe caused an Access Violation at location 74C59584 in module msvcrt.dll Reading from location 00000000.

Registers:
eax=00000000 ebx=00000009 ecx=00000002 edx=7efefeff esi=00000000 edi=03829000
eip=74c59584 esp=008ea230 ebp=034c25f8 iopl=0         nv up ei pl nz na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010202

AddrPC   Params
74C59584 03829000 00000000 00000009 msvcrt.dll!strncpy
004F6A74 00000000 00000009 00000000 gvim.exe
0044543B 00000009 00000000 00000008 gvim.exe
77115C0C 008EA8C0 008EACA0 00000000 ntdll.dll!RtlAllocateHeap
00452DDF 03828EE7 0382333E 00000008 gvim.exe

I also compared the speed of loading the day-old diary through its absolute path against the performance I get from VimwikiDiaryPrevDay. The former method is way faster.

@EinfachToll
Copy link
Member

Well, when searching for the current or next diary entry, Vimwiki first reads in the names of all existing diary files. How many diary files do you have roughly? And what do you mean by slow? Are we talking about 1 second or more like 10 seconds?

@llinfeng
Copy link
Author

Dear @EinfachToll, I think my first wiki is from year 2014, and I should have been writing daily diaries ever since. In total, there are roughly 1,500 *.wiki files. I think there shall be 1K or so diary files. Should I archive them somewhere else?

Also, here goes my test for the speed:

  • On Windows machine running M.2 SSD (the type that connects directly to the motherboard, yet not the fastest PCIe type), it takes 2-3 seconds;
  • On Windows machine running a normal 2.5-inch SSD, connected through the SATA port, it takes around 5-8 seconds to open up the diary from a day before.
  • On Linux machine running normal 2.5-inch SSD, it takes roughly 1 second to load from :VimwikiDiaryPreDay)
  • I don't have a computer running HDD

I notice that the wait-time is independent whether that day-old diary is loaded into a buffer or not. May the logic could first go with sourcing the open-buffers?

@EinfachToll
Copy link
Member

1500 files is much, but should not be too much for today's hardware. I will take a look.

EinfachToll added a commit that referenced this issue Apr 15, 2017
This is unnecessary and can be very slow when the user has many diary
files.
Ref #328
@EinfachToll
Copy link
Member

@llinfeng can you check out the dev branch and test it? It should be noticeable faster now.

@llinfeng
Copy link
Author

@EinfachToll I have tried, but it seems no difference on the machine from which I reported the problem. The issue I reported previously might has to do with a hardware defect on my end. Apologize for the confusion.

After tying on my other machines (not booting from this particular hard drive, but other newer SSD disks), performance is reasonable. Maybe I have kept using one SSD drive for too long (2 years from 2015 March). I have filed a RMA request to the manufacturer.

Here goes a brief list of response time (for VimwikiDiaryPrevDay and VimwikiDiaryNextDay) on various machines that I have access to:

  • Lenovo TS140 (Linux Mint with Samsung EVO 850): 1 second or less
  • Dell AW R5 (Windows 10 with M.2 SSD): 1 second or less;
  • HP EliteDesk G2 (Windows 10 with WD Blue SSD): 1 second or less
  • MacBook Air (Early 2015, SSD): 1.5 seconds or so;

The 10 seconds lat (max, avg around 6s) had only happened on my Thinkpad X230T machine with the 2-year-old Samsung 850 Pro SSD drive.

@llinfeng
Copy link
Author

Failed attempt

  • Replace the hard drive and migrate the system to the new hard drive (clone operation done through Reflect)
  • Switch to dev branch

More details

Under the dev branch, I have tried to use syntime to track possible rendering problems, and there does not appear to be any.
nothing_wrong
However, as with the old hard drive, I am experiencing:

  • 4~5 seconds lag when issuing command :VimwikiDiaryPreDay<CR>
  • 4~5 seconds lag when issuing command :VimwikiDiaryNextDay<CR>
  • The lag is persistent regardless of whether the file is in an active buffer or not. (I thought this should have been solved cleverly in the dev branch?)

Question:

Is there a way to track the time-consumption for each intermediate steps one perform in vim? For this particular case, I would like to track the processes that slows down the "file-opening event".

@llinfeng llinfeng reopened this May 11, 2017
@llinfeng
Copy link
Author

Update and partial solution

This is awkward, but the 4~5 seconds lag I was reporting may due largely to how I started my GVIM session. This appears to be a AutoHotKey script issue, where if I start the gvim.exe session through AHK, things are slow as I was reporting; however, if I were to start the gvim.exe session using the Windows Command Prompt, the lag is close to 1 second (per :VimwikiDiaryPreDay command).

@ranebrown ranebrown added this to Needs triage in Bug Triage Deprecated Mar 21, 2019
@ranebrown
Copy link
Contributor

@llinfeng It sounds like this was a configuration issue on your end. If you are still having problems please test against the latest dev branch and reopen this.

Bug Triage Deprecated automation moved this from Needs triage to Closed Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

3 participants