-
Notifications
You must be signed in to change notification settings - Fork 66
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
dotnet-httprepl prints usage very slowly, repeats characters in Linux #15
Comments
@glennc just a note here - @mlorbetske confirmed this issue isn't resident in anything other than 18.04 and that tests validated this. That said, 18.04 is going to become the LTS for Ubuntu so this is still a thing. |
The same behavior occurred at Kubuntu 18.04 at 2.2.0-preview3-35497 version. |
I started looking at this yesterday, it seems we need analogous tweaks to the stty settings for the REPL session like we do for mac. The slow printing seems to be coming from repeatedly accessing CursorTop and CursorLeft in MoveCaret causing it to run in to this issue. I'll be testing some changes that reduce the number of accesses significantly soon. |
Fix aspnet#503 Fix aspnet#492 Fix aspnet#491 Fix aspnet#486 Changes to improve #489
Fix aspnet#503 Fix aspnet#492 Fix aspnet#491 Fix aspnet#486 Changes to improve #489
Fix aspnet#502 Fix aspnet#492 Fix aspnet#491 Fix aspnet#486 Improves #489
Fix aspnet#502 Fix aspnet#492 Fix aspnet#491 Fix aspnet#486 Improves #489
The duplicated characters has been fixed in #507, however the slow printing is still happening |
Thanks for the update @mlorbetske - keep us posted and if we need to sync up or you uncover anything about which you're concerned during the fix ping us. cc @glennc |
@bradygaster, @mlorbetske, @karelz, @wtgodbe, since our meeting ended early, I used the refund to take a quick look at the "Slow terminal printing" issue. For me it's taking 6 seconds to output the result of "help", due to it making ~260 calls to get the current cursor position (which is the vast majority of the time), just to output the ~40 lines of help output (which, coincidentally or not, has ~260 words in it). I think the fix here needs to be stop getting the current cursor position so frequently: it should not be needed at all for output like this. We could of course look at optimizing the method that gets the current position, but fundamentally that method needs to write to the terminal, wait for the terminal to respond, read the terminal's response from stdin, and parse that response in order to pull out the relevant position information, and that's never going to be super fast; any optimization we did we just be removing some small overheads in the reading/writing/parsing. The only thing I can see that would make it orders of magnitude faster were if we were to cache the information and only get it again when it was invalidated by some external signal, which as we've talked about is going to be difficult to do reliably. |
As far as I can tell, between the various commits mlorbetske made back in October, the changes stephentoub made to help in February and the changes being made in https://github.com/dotnet/corefx/issues/31517, the only thing we're really waiting on here is the release of the changes in that latter issue with 3.0. But the two overall issues are essentially fixed as far as our code goes. @jodavis do you think this is safe to close? |
What's the experience now on Linux? Especially if we run the tool on .NET Core 2.2 (which will probably never have the fix for https://github.com/dotnet/corefx/issues/31517)? |
I can try this later this evening and report back. I have the same environment available in which I originally discovered this issue. Thanks for everyone's hard work on this. :) |
Actually, doing a quick test on Ubuntu 18.04 (in WSL2), it doesn't look like the duplicate characters thing has actually been fixed. The speed of printing is fine though (help prints almost instantaneously. Update: This appears to be an issue with OS detection. We're checking
So it looks like we need another way of detecting Ubuntu (and whatever other affecting distros there might be). |
Dan pointed us in the right direction over here: https://github.com/dotnet/corefx/issues/39366#issuecomment-510244486 So I'll get that fix in tomorrow probably. |
On further inspection on this, it appears that we may not need to do distro detection... so far, every distro I have tried (SLES 12, Ubuntu 16.04, Ubuntu 18.04 and RHEL 7.6) has the duplicate issue. Long-term we may need to do something to allow users to override the stty settings in preferences. But so far, it seems safe to just apply the |
This was fixed a bit back, closing now. |
Environment
dotnet --info
Output:Note:
dotnet
points to preview version on my machine.Slow terminal printing
I installed latest dotnet-httprepl with this command:
dotnet tool install -g dotnet-httprepl --version 2.2.0-preview3-35246 --add-source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
I created and ran a default webapi project:
dotnet new webapi && dotnet run
I spun up dotnet-httprepl with
dotnet-httprepl --help
The usage printed to the screen one line at a time extremely slowly. I timed it and it takes a full 10 seconds to print to the terminal.
Duplicated characters
The second issue is when I open a repl session, typing results in duplicate characters to be printed to the screen:
dotnet-httprepl http://localhost:5000
As you can see, it still understands the commands that are being typed, so I think it's just a display issue.
Also that string "Execute 'help' to se available commands" was copied verbatim from the output.
I'm looking forward to using this tool in my development! :)
The text was updated successfully, but these errors were encountered: