Execute shell commands in separate thread #23

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
2 participants
@frantic
Contributor

frantic commented Dec 17, 2012

This brings more complexity to the code, but makes UX better for people
with huge repositories (like me).

Feel free to reject if you are not ready to make that trade-off

frantic added some commits Dec 17, 2012

Execute shell commands in separate thread
This brings more complexity to the code, but makes UX better for people
with huge repositories (like me).
@jisaacks

This comment has been minimized.

Show comment Hide comment
@jisaacks

jisaacks Dec 19, 2012

Owner

@frantic please pull master back into this and fix the conflicts, thanks!

Owner

jisaacks commented Dec 19, 2012

@frantic please pull master back into this and fix the conflicts, thanks!

@frantic

This comment has been minimized.

Show comment Hide comment
@frantic

frantic Dec 20, 2012

Contributor

I will, if you are ok with this code complexity trade off :)

Contributor

frantic commented Dec 20, 2012

I will, if you are ok with this code complexity trade off :)

@jisaacks

This comment has been minimized.

Show comment Hide comment
@jisaacks

jisaacks Dec 20, 2012

Owner

@frantic I am not very experienced with python actually .. Is the defining of exec_diff inside of diff and write_git_file inside if update_git_file in order to create a closure around the callback?

Owner

jisaacks commented Dec 20, 2012

@frantic I am not very experienced with python actually .. Is the defining of exec_diff inside of diff and write_git_file inside if update_git_file in order to create a closure around the callback?

@frantic

This comment has been minimized.

Show comment Hide comment
@frantic

frantic Dec 20, 2012

Contributor

Those inner functions are used as callbacks, because shell commands are executed in separate thread. I put them inside higher level functions to not clutter class implementation and easily refer callback param.

Contributor

frantic commented Dec 20, 2012

Those inner functions are used as callbacks, because shell commands are executed in separate thread. I put them inside higher level functions to not clutter class implementation and easily refer callback param.

@jisaacks

This comment has been minimized.

Show comment Hide comment
@jisaacks

jisaacks Dec 20, 2012

Owner

@frantic the code looks good, I just need to test it locally before merging, I am leaving for holiday tonight, so it may be a couple days before I get to it, but didn't want you to think I was leaving ya hanging.

Owner

jisaacks commented Dec 20, 2012

@frantic the code looks good, I just need to test it locally before merging, I am leaving for holiday tonight, so it may be a couple days before I get to it, but didn't want you to think I was leaving ya hanging.

@jisaacks

This comment has been minimized.

Show comment Hide comment
@jisaacks

jisaacks Dec 22, 2012

Owner

@frantic, I was testing your code tonight, there is a small issue.

The fix to the undo had originally created an issue ( #26 ) where there was a flicker when adding/removing lines. It was because there was a small delay (the timeout). I was bugged by the flicker so I figured out a fix, if we used a window command instead of a text command, we don't have a speed problem anymore (so we don't need the timeout) and the undo does not break.

Ok so when I merge this into that fix, the flicker comes back. I think it is because there is a delay when waiting for the callback from the second thread.

To reproduce, insert a few lines, then delete all the inserted lines, watch the icons - you will see the "+" marks flicker into the wrong spot for a split second while waiting, then go to the correct spots.

It is minor but it is enough to distract me while I am coding.

Owner

jisaacks commented Dec 22, 2012

@frantic, I was testing your code tonight, there is a small issue.

The fix to the undo had originally created an issue ( #26 ) where there was a flicker when adding/removing lines. It was because there was a small delay (the timeout). I was bugged by the flicker so I figured out a fix, if we used a window command instead of a text command, we don't have a speed problem anymore (so we don't need the timeout) and the undo does not break.

Ok so when I merge this into that fix, the flicker comes back. I think it is because there is a delay when waiting for the callback from the second thread.

To reproduce, insert a few lines, then delete all the inserted lines, watch the icons - you will see the "+" marks flicker into the wrong spot for a split second while waiting, then go to the correct spots.

It is minor but it is enough to distract me while I am coding.

@frantic

This comment has been minimized.

Show comment Hide comment
@frantic

frantic Dec 22, 2012

Contributor

Yeah, I understand. Flicker on my hardware is hardly noticeable, but the delay when working with huge repo bothers me a lot. Probably my case is 1% so feel free to not merge this in :)

Contributor

frantic commented Dec 22, 2012

Yeah, I understand. Flicker on my hardware is hardly noticeable, but the delay when working with huge repo bothers me a lot. Probably my case is 1% so feel free to not merge this in :)

@jisaacks

This comment has been minimized.

Show comment Hide comment
@jisaacks

jisaacks Dec 31, 2012

Owner

@frantic I wonder if there is a way we can make the threading a feature that can be turned on in the settings like the git_gutter_live_mode setting. Speaking of that setting, it might also solve your problem.

Owner

jisaacks commented Dec 31, 2012

@frantic I wonder if there is a way we can make the threading a feature that can be turned on in the settings like the git_gutter_live_mode setting. Speaking of that setting, it might also solve your problem.

@jisaacks jisaacks closed this Feb 16, 2013

@frantic frantic deleted the frantic:multi-threading branch Feb 21, 2013

@frantic frantic restored the frantic:multi-threading branch Feb 21, 2013

@jisaacks

This comment has been minimized.

Show comment Hide comment
@jisaacks

jisaacks Mar 10, 2013

Owner

@frantic just wanted to let you know, there is now a setting (for ST3 only) called non_bocking that you can turn on to make it run in a separate thread. :)

Owner

jisaacks commented Mar 10, 2013

@frantic just wanted to let you know, there is now a setting (for ST3 only) called non_bocking that you can turn on to make it run in a separate thread. :)

@frantic

This comment has been minimized.

Show comment Hide comment
@frantic

frantic Mar 10, 2013

Contributor

thanks! :)

Contributor

frantic commented Mar 10, 2013

thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment