-
Notifications
You must be signed in to change notification settings - Fork 37
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
TabNine suggestions block Sublime for multiple seconds (on popup and selection) #113
Comments
Hey @kakra Thank you for the awesome breakdown of the issue. We indeed not friendly to copy-on-write situations, and we will look into improving that. Do you have any suggestions as to how to improve this? Or must we sacrifice consistency and batch write the state? |
I think SQlite has a solution for this by using write-ahead logging (that's the WAL files), here's some starting point on the topic: https://wiki.tnonline.net/w/Blog/SQLite_Performance_on_Btrfs Maybe the database files of TabNine should use something similar (I think you already use SQlite). I've already done that for other SQlite databases and it can be done without knowledge for that application using the steps described in the link, section "How to enable SQLite WAL" (bottom of the page). |
If possible, try to avoid fsync patterns for synchronization - fsync is quite horrible on btrfs performance-wise. Btrfs doesn't need it being a cow file system. But I'm not sure how to handle that, maybe through some env var like |
Also, avoid in-place updates of blocks in files and prefer appending data to some sort of log file which you could merge at process start or regular intervals back into the data file (similar to WAL). |
I'm not sure if SQlite has file access modes which use |
please complete the following information:
Issue Details:
During auto-complete (just when the popup is supposed to show up), Sublime often blocks short amounts of time, sometimes several seconds. Looking at the process monitor, you can see that TabNine hangs in disk state and spikes IO usage. This blocking makes working and typing in code unusable. Selecting a suggested TabNine entry also blocks the editor for up to multiple seconds sometimes. This blocking happens like every 3-4 keypresses.
Background:
metrics.db
is stored on a btrfs partition which uses copy-on-write. If I recreate.config/TabNine
withchattr +C
and copy all contents from a backup, this file inherits the nocow-attribute. With this, Sublime feels a little bit smoother but it's still not very good.TabNine should probably improve its IO patterns, and be copy-on-write friendly.
The system has 24 GB of RAM, and 11+ GB of that a available memory (around 10 GB of that is page cache). So this is not a low memory condition.
gz#6848
The text was updated successfully, but these errors were encountered: