Closed alexey-milovidov closed 2 years ago
See also #5.
I've tested performance of bestline
comparing to the fork of replxx
currently used in clickhouse-client.
The test is: paste megabyte of Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. ...
replxx
works perfectly fine (paste takes about one second).
bestline
get hung:
milovidov@milovidov-desktop:~/work/bestline$ ./bestline_example
hello> Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет. Привет
in
(gdb) bt
#0 0x00007fc59e67d1e7 in __GI___libc_write (fd=1, buf=0x1145680, nbytes=388) at ../sysdeps/unix/sysv/linux/write.c:26
#1 0x0000000000402e98 in bestlineWrite ()
#2 0x00000000004047e1 in bestlineRefreshLine ()
#3 0x0000000000404f06 in bestlineEditInsert ()
#4 0x00000000004028d1 in bestlineEdit ()
#5 0x0000000000401e44 in bestlineRaw ()
#6 0x00000000004029f2 in bestline ()
#7 0x0000000000407892 in main ()
And does not finish in minutes. And also while it is being hung it's not possible to interrupt it with Ctrl+C.
(It happens if Konsole is used as terminal emulator)
Btw recent replxx supports multiple line editing
@alexey-milovidov per your feedback I've made the maximum line length unlimited and ensured that it's efficient. I believe Bestline should now be able to handle the case of a line being larger than the terminal display even better than GNU Readline does now.
Enjoy!
As for replxx I don't know because I've never used it. Depending on the STL would be an immediate deal breaker for me, since I like to be able to produce 40kb static executable files, and I wouldn't want something as simple as a line reader to preclude me from having that.
Thank you! :+1: Also one important thing is the possibility to add user-defined syntax highlighting.
We are using https://github.com/AmokHuginnsson/replxx/ in ClickHouse. It is also a self-contained alternative to
readline
with many needed features comparing tolinenoise
.How does
bestline
compares toreplxx
in terms of feature set and usability?