{"action":"closed","issue":{"url":"https://api.github.com/repos/facelessuser/BracketHighlighter/issues/389","repository_url":"https://api.github.com/repos/facelessuser/BracketHighlighter","labels_url":"https://api.github.com/repos/facelessuser/BracketHighlighter/issues/389/labels{/name}","comments_url":"https://api.github.com/repos/facelessuser/BracketHighlighter/issues/389/comments","events_url":"https://api.github.com/repos/facelessuser/BracketHighlighter/issues/389/events","html_url":"https://github.com/facelessuser/BracketHighlighter/issues/389","id":190584067,"number":389,"title":"search_threshold to 50000 hangs Sublime Text several times","user":{"login":"evandrocoan","id":5332158,"avatar_url":"https://avatars.githubusercontent.com/u/5332158?v=3","gravatar_id":"","url":"https://api.github.com/users/evandrocoan","html_url":"https://github.com/evandrocoan","followers_url":"https://api.github.com/users/evandrocoan/followers","following_url":"https://api.github.com/users/evandrocoan/following{/other_user}","gists_url":"https://api.github.com/users/evandrocoan/gists{/gist_id}","starred_url":"https://api.github.com/users/evandrocoan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evandrocoan/subscriptions","organizations_url":"https://api.github.com/users/evandrocoan/orgs","repos_url":"https://api.github.com/users/evandrocoan/repos","events_url":"https://api.github.com/users/evandrocoan/events{/privacy}","received_events_url":"https://api.github.com/users/evandrocoan/received_events","type":"User","site_admin":false},"labels":[{"id":151827946,"url":"https://api.github.com/repos/facelessuser/BracketHighlighter/labels/Won't%20Fix","name":"Won't Fix","color":"bfd4f2","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-20T21:13:24Z","updated_at":"2016-11-25T18:59:30Z","closed_at":"2016-11-25T18:59:30Z","body":"## search_threshold to 50000 hangs Sublime Text several times\r\n\r\nMy question is, can the `BracketHighlighter` be run on a separate thread, so it cannot slow down Sublime Text?\r\n\r\nOn those thread was discussed about lagging about `BracketHighlighter`:\r\n\r\n1. [#84](https://github.com/facelessuser/BracketHighlighter/issues/84) Significant Highlight Threshold Limits \r\n1. [#207](https://github.com/facelessuser/BracketHighlighter/issues/207) is bracket highlighter asynchronous? \r\n\r\nRecently on the package `GitGutter` the pull request:\r\n\r\n1. [#321](https://github.com/jisaacks/GitGutter/pull/321) Introduce async invocations of git (real non-blocking behavior) (#230) \r\n1. [#230](https://github.com/jisaacks/GitGutter/issues/230) GitGutter causes massive lag when editing over sshfs \r\n\r\nIt fixed the Sublime Text lag/hang for the `GitGutter`. Does it is applicable for `BracketHighlighter` to fix this lagging behavior?\r\n\r\nFor easy reproduction and to show the better the hang effects, was chose to use the multi-selection by the arrow keys, to show how the performance is degraded.\r\n\r\nOn the examples, is used a big file with a matching paren with 46000 characters length. They are my user keybinding for Sublime Text. The file showed may be found on: https://github.com/evandrocoan/SublimeTextStudio/blob/develop/User/Default%20(Windows).sublime-keymap\r\n\r\n### Sublime Text Behavior for 500 and 50000\r\n\r\n1. At the first part on this video is enabled the `search_threshold` to 500 and performed mouse selections from down to up, very fast. Here we may notice a very good response.\r\n1. At the second part, is set the `search_threshold``to 50000 and performed the same mouse selections form down to up as on the first part, however Sublime Text does not respond most of the time and we got stuck.\r\n\r\n![short_version](https://cloud.githubusercontent.com/assets/5332158/20465773/a28e1562-af4c-11e6-9b98-12bb5511d84a.gif)\r\n\r\n\r\n### Plugin Host and Sublime Text CPU use for 500\r\n\r\nThis is a more detailed behavior from the the first part on this video just above when enabled the `search_threshold` to 500 and performed mouse selections from down to up, very fast. Here we may notice a very good response.\r\n\r\nThis was real motion gif, with 13MB, then GitHub does not allow to exceed 10MB, but it can still be see on this link: [http://i.imgur.com/102dYS5.gif](http://i.imgur.com/102dYS5.gif), just to wait it to be full loaded, before jump to performance measurement conclusions.\r\n\r\n\r\n### Plugin Host and Sublime Text CPU use for 50000\r\n\r\nAt the second part, is set the `search_threshold` to 50000 and performed the same mouse selections from down to up as on the first part, however Sublime Text does not respond most of the time and we got stuck. We may notice when Sublime Text hangs while seeing the CPU graphic update.\r\n\r\nWe may also notice an increase CPU use both from `Plugin Host` and `Sublime Text` from the [http://i.imgur.com/102dYS5.gif](http://i.imgur.com/102dYS5.gif) just above. Most of the time here, I as pressing the key to select up and down, but `Sublime Text` just keeps hanging.\r\nThis is just a example behavior for how much it hangs. Basically `Sublime Text` is completely unusable when the `search_threshold` is set to 50000 and we are on a file where it has enough length to put the `search_threshold` to work.\r\n\r\nAre the heavy calculations for the `search_threshold` performed on the main Sublime Text thread?\r\nIf they are not, then the calculations are so heavy the performing then using the `on_selection_modified_async` operations form `Plugin Host`? If so, they are overloading `Plugin Host`, and it is hanging `Sublime Text`. Then may then to be performed on another thread other than the `Sublime Text` and `Plugin Host`'s ones?\r\n\r\n![search_threshold_50000](https://cloud.githubusercontent.com/assets/5332158/20465759/5d2b609c-af4c-11e6-8306-36c6bf905f7e.gif)\r\n\r\n\r\n## Support Info\r\n```\r\n- ST ver.: 3126\r\n- Platform: windows\r\n- Arch: x32\r\n- Plugin ver.: 2.23.0\r\n- Install via PC: True\r\n- mdpopups ver.: 1.11.0\r\n- backrefs ver.: 1.0.post1\r\n- markdown ver.: 2.6.6\r\n- pygments ver.: 2.1a0\r\n- jinja2 ver.: 2.8\r\n```\r\n\r\n## Steps to Reproduce Issue\r\n\r\n1. Set the setting `search_threshold` to 50000\r\n1. Underclock your CPU to 1 GHz. Make sure you got 4 CPU cores working at 1GHz.\r\n1. To start working with sublime text on the big file as https://github.com/evandrocoan/SublimeTextStudio/blob/develop/User/Default%20(Windows).sublime-keymap with matching paren blocks within at least 46000 characters length.\r\n\r\nIf you got high speed CPU and it is perfectly responding, you may try to use a bigger file as 100000 characters for `search_threshold`. On windows the underclock is automatic for this option on the power manager: (may need a reboot to take effect)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5332158/20466133/5c0de0d8-af54-11e6-8184-199b32d8e048.png)\r\n\r\n"}}
{"actor":{"display_login":"facelessuser"}}