|
|
Home » Developing U++ » UppHub » A terminal emulator widget for U++
Re: A terminal emulator widget for U++ [message #53731 is a reply to message #51415] |
Sat, 25 April 2020 00:36 |
Oblivion
Messages: 1092 Registered: August 2007
|
Senior Contributor |
|
|
Hello,
I have pushed the the critical performance fix that I mentioned in my last message.
The main culprit was using a Vector where a BiVector was a much better option. In fact, it seems to be the optimal solution to the scrollback/hsitory buffer problem. Removing elements from the beginning of a Vector, especially when its length > 64K is -not surprisingly- very slow. BiVector solves exactly this problem because a scrollback buffer is mutated only from the either end.
There was also a constant display refresh happening when a page was scrolled, even when a single line scrolled, degrading performance. This is fixed too.
Now Terminal ctrl's scroll speed / throughput can be very fast. (It is Even faster than the above given numbers: ~3.5 secoonds on the same test while acting as a both SSH (using Upp/SSH package) and local terminal. ("time find /usr/share" command was outputting > 300.000 file paths in these tests, with the size of scrollback buffer of each terminal was set to 64 k)
However, you can't see the real difference if you use the provided reference example codes, because they have a very rudimentary event loop.
If you are curious and you want to test the scrolling/throughput performance of Terminal ctrl, you can use the below code: While still rudimentary, it is closer to real world scenarios.
#include <Terminal/Terminal.h>
#include <Terminal/PtyProcess.h>
using namespace Upp;
const char *nixshell = "/bin/bash";
struct TerminalExample : TopWindow {
Terminal term;
PtyProcess pty;
TerminalExample()
{
SetRect(term.GetStdSize());
Sizeable().Zoomable().CenterScreen().Add(term.SizePos());
term.WhenBell = [=]() { BeepExclamation(); };
term.WhenTitle = [=](String s) { Title(s); };
term.WhenOutput = [=](String s) { pty.Write(s); };
term.WhenResize = [=]() { pty.SetSize(term.GetPageSize()); };
term.WhenLink = [=](const String& s) { PromptOK(s); };
term.InlineImages().Hyperlinks().WindowOps().DynamicColors();
term.SetHistorySize(65536);
}
void Run()
{
pty.Start(nixshell, Environment(), GetHomeDirectory());
OpenMain();
while(IsOpen() && pty.IsRunning()) {
int ms = 16;
String in = pty.Get();
if(!IsNull(in)) {
term.WriteUtf8(in);
int len = in.GetLength();
if(len >= 1024)
ms = 1024 * 16 / len; // Scale to workload...
}
ProcessEvents();
Sleep(ms);
}
}
};
GUI_APP_MAIN
{
TerminalExample().Run();
}
There are other improvements and bug fixes too (mostly on serialization/xmlization/jsonization fronts).
If you have any questions, criticism, bug reports, patches, ideas, let me know.
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Sat, 25 April 2020 01:06] Report message to a moderator
|
|
|
|
|
A terminal emulator widget for U++
By: Oblivion on Sat, 23 March 2019 22:31
|
|
|
Re: A terminal emulator widget for U++
By: koldo on Sun, 24 March 2019 16:15
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Tue, 26 March 2019 10:02
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Tue, 26 March 2019 13:11
|
|
|
Re: A terminal emulator widget for U++
By: koldo on Tue, 26 March 2019 13:21
|
|
|
Re: A terminal emulator widget for U++
By: Novo on Wed, 27 March 2019 23:14
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Thu, 28 March 2019 08:01
|
|
|
Re: A terminal emulator widget for U++
By: Novo on Thu, 28 March 2019 16:57
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Thu, 28 March 2019 19:21
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Mon, 08 April 2019 11:45
|
|
|
Re: A terminal emulator widget for U++
By: Xemuth on Mon, 13 May 2019 13:47
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
By: Xemuth on Tue, 16 July 2019 09:34
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
By: koldo on Fri, 26 July 2019 08:18
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Fri, 02 August 2019 13:54
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Wed, 07 August 2019 21:24
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Mon, 12 August 2019 11:39
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Fri, 16 August 2019 14:29
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sun, 22 September 2019 12:01
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 28 September 2019 22:00
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sun, 03 November 2019 15:03
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sun, 10 November 2019 21:49
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Tue, 12 November 2019 16:36
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Tue, 12 November 2019 20:08
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Wed, 25 March 2020 14:20
|
|
|
Re: A terminal emulator widget for U++
By: deep on Wed, 25 March 2020 19:12
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Thu, 26 March 2020 16:54
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Fri, 10 April 2020 02:17
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 11 April 2020 00:30
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Fri, 17 April 2020 22:30
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Tue, 21 April 2020 18:35
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Wed, 22 April 2020 18:51
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 25 April 2020 00:36
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
By: Zbych on Thu, 11 June 2020 00:13
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
By: Zbych on Sun, 21 June 2020 22:16
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
By: Zbych on Sun, 21 June 2020 22:47
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
By: Zbych on Thu, 25 June 2020 20:40
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 01 August 2020 20:48
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Fri, 21 August 2020 13:29
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 05 September 2020 16:45
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Thu, 01 October 2020 18:11
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Tue, 13 October 2020 12:41
|
|
|
Re: A terminal emulator widget for U++
By: Klugier on Tue, 13 October 2020 20:41
|
|
|
Re: A terminal emulator widget for U++
By: hongnod on Thu, 03 December 2020 15:05
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Thu, 03 December 2020 16:25
|
|
|
Re: A terminal emulator widget for U++
By: hongnod on Fri, 04 December 2020 06:58
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 05 December 2020 16:21
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Wed, 09 December 2020 00:54
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 23 January 2021 01:25
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Mon, 01 February 2021 21:18
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Wed, 03 February 2021 17:12
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Fri, 12 February 2021 17:42
|
|
|
Re: A terminal emulator widget for U++
By: Klugier on Fri, 12 February 2021 21:58
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Fri, 12 February 2021 22:26
|
|
|
Re: A terminal emulator widget for U++
By: Klugier on Fri, 12 February 2021 23:00
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Fri, 12 February 2021 23:14
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Tue, 23 February 2021 22:57
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 27 February 2021 22:07
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Mon, 01 March 2021 23:49
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Wed, 03 March 2021 20:45
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sun, 07 March 2021 14:42
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
By: Novo on Tue, 15 June 2021 16:41
|
|
|
Re: A terminal emulator widget for U++
By: Klugier on Fri, 26 November 2021 23:19
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 27 November 2021 07:51
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 27 November 2021 10:47
|
|
|
Re: A terminal emulator widget for U++
By: slashupp on Tue, 21 December 2021 07:39
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Tue, 21 December 2021 09:40
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 12 February 2022 19:16
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Compile problem on WIN10
By: peterh on Tue, 13 September 2022 15:15
|
|
|
Re: Compile problem on WIN10
By: Oblivion on Tue, 13 September 2022 21:39
|
|
|
Re: Compile problem on WIN10
By: peterh on Wed, 14 September 2022 03:48
|
|
|
Re: Compile problem on WIN10
By: Oblivion on Thu, 15 September 2022 00:31
|
|
|
Re: Compile problem on WIN10
By: peterh on Thu, 15 September 2022 06:54
|
|
|
Re: Compile problem on WIN10
By: Oblivion on Thu, 15 September 2022 07:14
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Thu, 15 September 2022 07:25
|
|
|
Re: A terminal emulator widget for U++
By: peterh on Thu, 15 September 2022 07:58
|
|
|
Re: A terminal emulator widget for U++
By: peterh on Thu, 15 September 2022 09:03
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Thu, 15 September 2022 19:09
|
|
|
Re: A terminal emulator widget for U++
By: peterh on Fri, 16 September 2022 06:10
|
|
|
Re: A terminal emulator widget for U++
By: peterh on Fri, 16 September 2022 07:41
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 17 September 2022 18:40
|
|
|
Re: A terminal emulator widget for U++
By: peterh on Sat, 17 September 2022 20:58
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sun, 20 November 2022 21:11
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 31 December 2022 11:19
|
|
|
Re: A terminal emulator widget for U++
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sun, 17 December 2023 15:04
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Fri, 22 December 2023 00:23
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 06 January 2024 21:45
|
|
|
Re: A terminal emulator widget for U++
By: Oblivion on Sat, 13 April 2024 10:42
|
Goto Forum:
Current Time: Fri Apr 19 02:31:57 CEST 2024
Total time taken to generate the page: 0.03137 seconds
|
|
|