oleg-shilo / cs-script-sublime

Sublime Text 3 plugin for CS-Script
MIT License
9 stars 1 forks source link

CS-Script Hangs Sublime Text for a Few Seconds #1

Closed mmickael closed 6 years ago

mmickael commented 6 years ago

Sublime freezes for a few seconds at startup when CS-Script is installed. Looks like this is caused by loading syntaxer.exe at startup but I am not 100% sure. Sublime version is 3143. Cs-Script version 1.2.6.

oleg-shilo commented 6 years ago

Thank you for reporting it.

I was trying to avoid any loading penalties. That's why all syntaxer loading operations are asynchronous. E.g. popen is never followed by wait.

Anyway, I cannot detect any delays in my environment so I added some prints for loading stats. I hope you wouldn't mind to run the updated version of syntaxer (with new prints).

In my case the loading is very quick. Let's see if you numbers are different. image

mmickael commented 6 years ago

Oleg,

Thank you for the quick reply. I tried the updated file. Here are my results.

syntaxer_dir C:\Programs\Sublime Text 3\Data\Packages\User\cs-script\syntaxer_v1.2.6

Syntaxer server started: 0.01561594009399414 seconds

I did not notice much improvement in the freezing issue (roughly 2-3 seconds after startup). I will try to record a startup session to illustrate the issue.

--

Regards,

Medhat Mickael

From: Oleg Shilo [mailto:notifications@github.com] Sent: Monday, October 30, 2017 5:18 AM To: oleg-shilo/cs-script-sublime cs-script-sublime@noreply.github.com Cc: Medhat Mickael mmickael@innovativedhs.com; Author author@noreply.github.com Subject: Re: [oleg-shilo/cs-script-sublime] CS-Script Hangs Sublime Text for a Few Seconds (#1)

Thank you for reporting it.

I was trying to avoid any loading penalties. That's why all syntaxer loading operations are asynchronous. E.g. popen is never followed by wait.

Anyway, I cannot detect any delays in my environment so I added some prints for loading stats. I hope you wouldn't mind to run the updated versionhttps://github.com/oleg-shilo/cs-script-sublime/blob/master/imports/syntaxer.py of syntaxer (with new prints).

In my case the loading is very quick. Let's see if you numbers are different. [image]https://user-images.githubusercontent.com/16729806/32165268-4b786eb6-bdb6-11e7-93f2-88a637222ca5.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/oleg-shilo/cs-script-sublime/issues/1#issuecomment-340401440, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMk0ica9iEbXhosyZPJWWGWpE3MeR-Bcks5sxaJdgaJpZM4QKKeJ.

Confidentiality Notice. The information in this transmission may contain proprietary and confidential information of Innovative Downhole Solutions and may be subject to protection under the law. The message is intended for the sole use of the individual or entity to which it is addressed. If you are not the intended recipient, you are notified that any use, distribution or copying of the message is strictly prohibited. If you received this message in error, delete the material from your system without reading the content and notify the sender immediately of the inadvertent transmission.

mmickael commented 6 years ago

Oleg,

I think I found the problem. In the session log, I noticed an error indicating that it could not find the location of “cscs.exe” and will retry in 3 seconds. I have a portable installation of Sublime so I added the path of cscs.exe to the user setting.

            "cscs_path": "C:\\Programs\\Sublime Text 3\\Data\\Packages\\cs-script-sublime\\bin\\cscs.exe",

And it no longer hangs. I will close the issue with this explanation in case someone else has the same problem.

--

Regards,

Medhat Mickael President, Innovative Downhole Solutions 17810 East Hardy Road, Houston, TX 77073 Main: (832) 827-2908 Fax: (281) 784-2370 Mobile: (713) 503-4221 www.innovativedhs.comhttp://www.innovativedhs.com/

From: Oleg Shilo [mailto:notifications@github.com] Sent: Monday, October 30, 2017 5:18 AM To: oleg-shilo/cs-script-sublime cs-script-sublime@noreply.github.com Cc: Medhat Mickael mmickael@innovativedhs.com; Author author@noreply.github.com Subject: Re: [oleg-shilo/cs-script-sublime] CS-Script Hangs Sublime Text for a Few Seconds (#1)

Thank you for reporting it.

I was trying to avoid any loading penalties. That's why all syntaxer loading operations are asynchronous. E.g. popen is never followed by wait.

Anyway, I cannot detect any delays in my environment so I added some prints for loading stats. I hope you wouldn't mind to run the updated versionhttps://github.com/oleg-shilo/cs-script-sublime/blob/master/imports/syntaxer.py of syntaxer (with new prints).

In my case the loading is very quick. Let's see if you numbers are different. [image]https://user-images.githubusercontent.com/16729806/32165268-4b786eb6-bdb6-11e7-93f2-88a637222ca5.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/oleg-shilo/cs-script-sublime/issues/1#issuecomment-340401440, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMk0ica9iEbXhosyZPJWWGWpE3MeR-Bcks5sxaJdgaJpZM4QKKeJ.

Confidentiality Notice. The information in this transmission may contain proprietary and confidential information of Innovative Downhole Solutions and may be subject to protection under the law. The message is intended for the sole use of the individual or entity to which it is addressed. If you are not the intended recipient, you are notified that any use, distribution or copying of the message is strictly prohibited. If you received this message in error, delete the material from your system without reading the content and notify the sender immediately of the inadvertent transmission.

mmickael commented 6 years ago

Issue fixed by specifying the absolute path of cscs.exe in user settings. This may only apply to portable installation of Sublime Text.

oleg-shilo commented 6 years ago

Unfortunately the work around you found is not fixing but I am afraid masking the problem. So I am reopening the issue. At least for now.

Another important point is that setting cscs_path to the plugin original cscs.exe but not to its copy in User can cause unpredictable behavior during plugin updates. That's why I advice to revert it and try to solve it in a more direct way. But of course it's your call.

I noticed an error indicating that it could not find the location of “cscs.exe” and will retry in 3 seconds.

The problem is not about the cscs.exe location. In the routine the plugin is trying to connect to the syntaxer server and it is expected to fail (socket exception) the first attempt. The server is not ready just after the start. That's why on error it will delay and try again up to 5 times. BTW your "Syntaxer server started" log indicated that you spent practically no time there.

I think problem is somewhere else. Since I cannot detect the problem I would like to ask you to test it again. Please use the latest cs-script.py and imports/*. I have placed a few changes there that can in fact bring some improvements not only print stats:

Thank you for your help with testing this issue.

mmickael commented 6 years ago

Oleg,

This fixed the problem as well. Here is what I did:

  1. Copied cs-script.py to \Sublime Text 3\Data\Packages\cs-script-sublime
  2. Copied imports/* to \Sublime Text 3\Data\Packages\cs-script-sublime\imports
  3. Removed cscs_path from user settings
  4. The cscs_path is set to “./cscs.exe” in default settings

There is no more delays. Console output shows the following:


cscs.exe: C:\Programs\Sublime Text 3\Data\Packages\cs-script-sublime\bin\cscs.exe syntaxer.exe: C:\Programs\Sublime Text 3\Data\Packages\User\cs-script\syntaxer_v1.2.6\syntaxer.exe syntaxer port: 18000 syntaxcheck_on_save: False server_autostart: True

reloading settings Packages/User/cs-script.sublime-settings Package Control: Skipping automatic upgrade, last run at 2017-10-31 09:17:41, next run at 2017-10-31 10:17:41 or after

Connected to syntaxer server: 0.0010058879852294922 seconds Roslyn preloading done: 0.0005319118499755859 seconds

Thank you for looking into this issue and for the very useful plugin.

--

Regards,

Medhat Mickael

From: Oleg Shilo [mailto:notifications@github.com] Sent: Tuesday, October 31, 2017 5:52 AM To: oleg-shilo/cs-script-sublime cs-script-sublime@noreply.github.com Cc: Medhat Mickael mmickael@innovativedhs.com; State change state_change@noreply.github.com Subject: Re: [oleg-shilo/cs-script-sublime] CS-Script Hangs Sublime Text for a Few Seconds (#1)

Unfortunately the work around you found is not fixing but I am afraid masking the problem. So I am reopening the issue. At least for now.

Another important point is that setting cscs_path to the plugin original cscs.exe but not to its copy in User can cause unpredictable behavior during plugin updates. That's why I advice to revert it and try to solve it in a more direct way. But of course it's your call.

I noticed an error indicating that it could not find the location of “cscs.exe” and will retry in 3 seconds.

The problem is not about the cscs.exe location. In the routine the plugin is trying to connect to the syntaxer server and it is expected to fail (socket exception) the first attempt. The server is not ready just after the start. That's why on error it will delay and try again up to 5 times. BTW your "Syntaxer server started" log indicated that you spent practically no time there.

I think problem is somewhere else. Since I cannot detect the problem I would like to ask you to test it again. Please use the latest cs-script.py and imports/*. I have placed a few changes there that can in fact bring some improvements not only print stats:

Thank you for your help with testing this issue.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/oleg-shilo/cs-script-sublime/issues/1#issuecomment-340726674, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMk0iWo62SWgcZrDXqs1vcPXe-eP2XRsks5sxvu3gaJpZM4QKKeJ.

Confidentiality Notice. The information in this transmission may contain proprietary and confidential information of Innovative Downhole Solutions and may be subject to protection under the law. The message is intended for the sole use of the individual or entity to which it is addressed. If you are not the intended recipient, you are notified that any use, distribution or copying of the message is strictly prohibited. If you received this message in error, delete the material from your system without reading the content and notify the sender immediately of the inadvertent transmission.

oleg-shilo commented 6 years ago

Excellent. Thank you. for helping me with the testing. Otherwise it was like trying to catch the black cat in the dark room. :)

oleg-shilo commented 6 years ago

Done. Please update to Release v1.2.6

mmickael commented 6 years ago

Oleg,

I thought the version I was running was already 1.2.6.

--

Regards,

Medhat Mickael

From: Oleg Shilo [mailto:notifications@github.com] Sent: Wednesday, November 1, 2017 7:11 PM To: oleg-shilo/cs-script-sublime cs-script-sublime@noreply.github.com Cc: Medhat Mickael mmickael@innovativedhs.com; State change state_change@noreply.github.com Subject: Re: [oleg-shilo/cs-script-sublime] CS-Script Hangs Sublime Text for a Few Seconds (#1)

Done. Please update to Release v1.2.6

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/oleg-shilo/cs-script-sublime/issues/1#issuecomment-341280544, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMk0iYADLnbdtpdl1FIm9Zsb9gb0tmnWks5syQiJgaJpZM4QKKeJ.

Confidentiality Notice. The information in this transmission may contain proprietary and confidential information of Innovative Downhole Solutions and may be subject to protection under the law. The message is intended for the sole use of the individual or entity to which it is addressed. If you are not the intended recipient, you are notified that any use, distribution or copying of the message is strictly prohibited. If you received this message in error, delete the material from your system without reading the content and notify the sender immediately of the inadvertent transmission.

oleg-shilo commented 6 years ago

Not exactly. At the time you were testing it the officially released version was v1.2.5. I only increased the version in the source code in anticipation of the future release but did not make a new release from it. It was just a set of files with the fixes under the source control.

Please let me know if somehow it creates any problems. I am OK to just re-release with the incremented version it if required.

mmickael commented 6 years ago

Oleg,

The version that was installed from Package Control before this issue from https://github.com/oleg-shilo/cs-script-sublime.git was 1.2.6https://github.com/oleg-shilo/cs-script-sublime.git%20was%201.2.6. My user settings shows that version as well. I do not think it is an issue. I can just uninstall it and install it gain.

--

Regards,

Medhat Mickael

From: Oleg Shilo [mailto:notifications@github.com] Sent: Thursday, November 2, 2017 6:41 PM To: oleg-shilo/cs-script-sublime cs-script-sublime@noreply.github.com Cc: Medhat Mickael mmickael@innovativedhs.com; State change state_change@noreply.github.com Subject: Re: [oleg-shilo/cs-script-sublime] CS-Script Hangs Sublime Text for a Few Seconds (#1)

Not exactly. At the time you were testing it the officially released version was v1.2.5. I only increased the version in the source code in anticipation of the future release but did not make a new release from it. It was just a set of files with the fixes under the source control.

Please let me know if somehow it creates any problems. I am OK to just re-release with the incremented version it if required.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/oleg-shilo/cs-script-sublime/issues/1#issuecomment-341589926, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMk0iSiEGVdHQnCHPOihG3L0wFUGLn5vks5sylMKgaJpZM4QKKeJ.

Confidentiality Notice. The information in this transmission may contain proprietary and confidential information of Innovative Downhole Solutions and may be subject to protection under the law. The message is intended for the sole use of the individual or entity to which it is addressed. If you are not the intended recipient, you are notified that any use, distribution or copying of the message is strictly prohibited. If you received this message in error, delete the material from your system without reading the content and notify the sender immediately of the inadvertent transmission.

oleg-shilo commented 6 years ago

Then it is my mistake with GitHub package management. I do prefer to fix it though. Done. Rereleased the same codebase as v1.2.7. Thank you.

mmickael commented 6 years ago

Thanks.

--

Regards,

Medhat Mickael

From: Oleg Shilo [mailto:notifications@github.com] Sent: Thursday, November 2, 2017 7:00 PM To: oleg-shilo/cs-script-sublime cs-script-sublime@noreply.github.com Cc: Medhat Mickael mmickael@innovativedhs.com; State change state_change@noreply.github.com Subject: Re: [oleg-shilo/cs-script-sublime] CS-Script Hangs Sublime Text for a Few Seconds (#1)

Then it is my mistake with GitHub package management. I do prefer to fix it though. Done. Rereleased the same codebase as v1.2.7. Thank you.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/oleg-shilo/cs-script-sublime/issues/1#issuecomment-341592810, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMk0iXxtf9eFeOEigDaCvZy4AO1NeLkoks5syleBgaJpZM4QKKeJ.

Confidentiality Notice. The information in this transmission may contain proprietary and confidential information of Innovative Downhole Solutions and may be subject to protection under the law. The message is intended for the sole use of the individual or entity to which it is addressed. If you are not the intended recipient, you are notified that any use, distribution or copying of the message is strictly prohibited. If you received this message in error, delete the material from your system without reading the content and notify the sender immediately of the inadvertent transmission.