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

Very slow startup on tdcli #2

Closed
punassuming opened this issue Oct 22, 2011 · 5 comments
Closed

Very slow startup on tdcli #2

punassuming opened this issue Oct 22, 2011 · 5 comments

Comments

@punassuming
Copy link

Whenever, I launch tdcli, I am getting extremely slow startups, on the order of 30 seconds, even after I have authenticated completely. I am not sure what is causing the delay, but I have tried looking at python -v tdcli it it holds for most of the time after showing import StringIO.

When I import StringIO, or any of the other import commands I see when viewing the verbose log, I have no delay.

@handyman5
Copy link
Owner

It's not actually StringIO's fault; the delay comes from assembling the lexer that parses the task string. Plex (the lexer library I'm using) only causes a delay of a couple of seconds on my machine, but I can see where it would take a lot longer under other conditions.

I'll look into replacing plex with the built-in re.Scanner tool: http://www.evanfosmark.com/2009/02/sexy-lexing-with-python/. Thanks for the bug report!

@handyman5
Copy link
Owner

I've added a cache of the lexer object, so that once it's been generated it will be re-used between runs. It significanty improves performance on my machine. Can you please check it out and see if it helps on your end?

@punassuming
Copy link
Author

Adam,

That seemed to really pick things up. One other problem I am having
is the need to add an app_id and app_token myself to the AppClient
class whenever I update the repo. Is there any way to add that stuff
into the rc file to prevent this?

Thanks,

Rich

On Fri, Nov 11, 2011 at 11:56 AM, Adam Compton
[email protected]
wrote:

I've added a cache of the lexer object, so that once it's been generated it will be re-used between runs. It significanty improves performance on my machine. Can you please check it out and see if it helps on your end?


Reply to this email directly or view it on GitHub:
#2 (comment)

Rich

@handyman5
Copy link
Owner

Great idea! I've added that to the latest commit. Please try it out and let me know what you think.

Thanks,
Adam

@handyman5
Copy link
Owner

The current code doesn't use the lexer (or its cache) anymore, and the other issue was addressed a year ago. Closing this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants