fish-shell/src
Fabian Boehm 7bc4c9674b builtins: Reduce streams.out.append/push_back calls
This basically immediately issues a "write()" if it's to a pipe or the
terminal.

That means we can reduce syscalls and improve performance, even by
doing something like

```c++
streams.out.append(somewcstring + L"\n");
```

instead of

```c++
streams.out.append(somewcstring);
streams.out.push_back(L'\n');
```

Some benchmarks of the

```fish
for i in (string repeat -n 2000 \n)
    $thing
end
```

variety:

1. `set` (printing variables) sped up 1.75x
2. `builtin -n` 1.60x
3. `jobs` 1.25x (with 3 jobs)
4. `functions` 1.20x
5. `math 1 + 1` 1.1x
6. `pwd` 1.1x

Piping yields similar results, there is no real difference when
outputting to a command substitution.
2022-09-22 22:41:35 +02:00
..
builtins builtins: Reduce streams.out.append/push_back calls 2022-09-22 22:41:35 +02:00
widecharwidth Update widecharwidth 2022-02-14 22:19:28 +01:00
ast_node_types.inc Introduce a new fish ast 2020-07-04 14:58:02 -07:00
ast.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
ast.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
autoload.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
autoload.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
builtin.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
builtin.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
color.cpp color: Use convert_digit 2022-08-27 11:41:29 +02:00
color.h clang-format all C++ files 2022-08-21 15:02:19 -07:00
common.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
common.h Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
complete.cpp fixup! Fix stomping of last_option_requires_param 2022-09-20 22:37:17 -05:00
complete.h Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
enum_map.h enum_map stuff to enum_map.h 2021-10-01 03:39:43 -07:00
enum_set.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
env_dispatch.cpp Remove some dead code 2022-08-27 20:33:39 +02:00
env_dispatch.h Revert "I need to take a break. Fixup." 2022-08-22 14:11:52 -07:00
env_universal_common.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
env_universal_common.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
env.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
env.h Revert "I need to take a break. Fixup." 2022-08-22 14:11:52 -07:00
event.cpp IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
event.h Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
exec.cpp Revert "I need to take a break. Fixup." 2022-08-22 14:11:52 -07:00
exec.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
expand.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
expand.h Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
fallback.cpp Add IWYU pragma 2022-09-13 06:56:52 -07:00
fallback.h IWYU 2022-09-12 18:34:19 -07:00
fd_monitor.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
fd_monitor.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
fds.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
fds.h clang-format all C++ files 2022-08-21 15:02:19 -07:00
fish_indent.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
fish_key_reader.cpp IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
fish_test_helper.cpp Prevent anyone else from wasting time w/ sigqueue(2) 2022-09-16 18:53:05 -05:00
fish_tests.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
fish_version.cpp Fix build 2021-09-21 18:33:14 -07:00
fish_version.h
fish.cpp IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
flog.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
flog.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
function.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
function.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
future_feature_flags.cpp IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
future_feature_flags.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
global_safety.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
highlight.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
highlight.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
history_file.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
history_file.h clang-format all C++ files 2022-08-21 15:02:19 -07:00
history.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
history.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
input_common.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
input_common.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
input.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
input.h Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
io.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
io.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
iothread.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
iothread.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
job_group.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
job_group.h clang-format all C++ files 2022-08-21 15:02:19 -07:00
kill.cpp IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
kill.h Implementation of variable with killring entries 2021-04-21 16:39:29 -07:00
lru.h Reimplement autosuggestion-triggered completion loading 2022-06-19 15:15:17 -07:00
maybe.h maybe.h: reference header new 2021-08-17 18:57:16 -05:00
null_terminated_array.cpp Rework null terminated arrays 2021-03-28 15:31:25 -07:00
null_terminated_array.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
operation_context.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
operation_context.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
output.cpp IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
output.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
pager.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
pager.h Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
parse_constants.h Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
parse_execution.cpp command_not_found: Add special error for ENOTDIR 2022-09-14 18:01:01 +02:00
parse_execution.h clang-format all C++ files 2022-08-21 15:02:19 -07:00
parse_tree.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
parse_tree.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
parse_util.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
parse_util.h clang-format all C++ files 2022-08-21 15:02:19 -07:00
parser_keywords.cpp IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
parser_keywords.h Remove unused functions, members (and a variable) 2022-04-09 10:10:44 -07:00
parser.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
parser.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
path.cpp path: Don't try to find empty commands 2022-09-14 18:18:08 +02:00
path.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
postfork.cpp IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
postfork.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
print_help.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
print_help.h
proc.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
proc.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
re.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
re.h Remove a variable name in a defaulted function 2022-09-20 14:41:22 -07:00
reader.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
reader.h reader: when updating commandline, also update rendered highlighting 2022-09-16 19:21:21 -05:00
redirection.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
redirection.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
screen.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
screen.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
signal.cpp IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
signal.h Restyle codebase with clang-format 2021-11-08 12:21:11 -08:00
termsize.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
termsize.h clang-format all C++ files 2022-08-21 15:02:19 -07:00
timer.cpp timer.cpp: iwyu; update includes 2022-08-30 23:56:33 -07:00
timer.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
tinyexpr.cpp clang-format and minor cleanup of tinyexpr.cpp 2022-09-20 14:41:22 -07:00
tinyexpr.h math: Add error length 2022-09-09 18:52:45 +02:00
tokenizer.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
tokenizer.h Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
topic_monitor.cpp IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
topic_monitor.h clang-format all C++ files 2022-08-21 15:02:19 -07:00
trace.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
trace.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
utf8.cpp Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
utf8.h Revert "Re-implement macro to constexpr transition" 2022-09-20 11:58:37 -07:00
util.cpp IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
util.h
wait_handle.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
wait_handle.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
wcstringutil.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
wcstringutil.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
wgetopt.cpp clang-format all C++ files 2022-08-21 15:02:19 -07:00
wgetopt.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
wildcard.cpp wildcard: Use wreaddir_resolving if directories are needed 2022-09-21 19:49:17 +02:00
wildcard.h IWYU-guided #include rejiggering. 2022-08-20 23:55:18 -07:00
wutil.cpp wreaddir_resolving: Don't add "/" for empty paths 2022-09-21 19:49:17 +02:00
wutil.h Fix build on macOS 10.10 Yosemite 2022-09-22 14:00:58 -05:00