Skip to content

Commit

Permalink
Improve performance of CLI output
Browse files Browse the repository at this point in the history
The purpose of AnsiConsole is to install an AnsiOutputStream which
either strips out ANSI escape sequences or interprets them differently
on Windows. The CLI only uses ANSI in interactive mode, so we don't
need to pay the substantial performance overhead of filtering the output
in batch mode (such as when redirecting the output to a file).
  • Loading branch information
nezihyigitbasi authored and electrum committed Apr 7, 2016
1 parent e91e7d5 commit 160ecd2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void run()
boolean hasQuery = !Strings.isNullOrEmpty(clientOptions.execute);
boolean isFromFile = !Strings.isNullOrEmpty(clientOptions.file);

if (!hasQuery || !isFromFile) {
if (!hasQuery && !isFromFile) {
AnsiConsole.systemInstall();
}

Expand Down
1 change: 1 addition & 0 deletions presto-docs/src/main/sphinx/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Release Notes
.. toctree::
:maxdepth: 1

release/release-0.145
release/release-0.144
release/release-0.143
release/release-0.142
Expand Down
8 changes: 8 additions & 0 deletions presto-docs/src/main/sphinx/release/release-0.145.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
=============
Release 0.145
=============

CLI Changes
-----------

* Improve performance of output in batch mode.

0 comments on commit 160ecd2

Please sign in to comment.