forked from extern/nushell
9c7feb2b19
For the width calculations for table layout the `strip_ansi` function has to be called frequently. By checking for the ASCII control chars (0x00 to 0x1f) except `\n` that are stripped by `strip_ansi_escapes` the number of necessary allocations can be reduced significantly for the simple case of text not containing ANSI escapes. **Benchmark:** ``` nu -c "for i in 0..1000 { ls } | flatten | table" ``` **Allocation reduction** Running on the nushell repo root as the directory, this change reduces the allocation volume by approximately 400 MB (Measured run via KDE heaptrack) **Speed improvement to output** Measured via `/usr/bin/time -v` *before* ``` Command being timed: "./eager_nu -c for i in 0..1000 {ls} | flatten | table" User time (seconds): 0.87 System time (seconds): 0.14 Percent of CPU this job got: 87% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:01.16 Average shared text size (kbytes): 0 Average unshared data size (kbytes): 0 Average stack size (kbytes): 0 Average total size (kbytes): 0 Maximum resident set size (kbytes): 18888 Average resident set size (kbytes): 0 Major (requiring I/O) page faults: 0 Minor (reclaiming a frame) page faults: 4809 Voluntary context switches: 38 Involuntary context switches: 14 Swaps: 0 File system inputs: 0 File system outputs: 0 Socket messages sent: 0 Socket messages received: 0 Signals delivered: 0 Page size (bytes): 4096 Exit status: 0 ``` *after* ``` Command being timed: "./lazy_nu -c for i in 0..1000 {ls} | flatten | table" User time (seconds): 0.63 System time (seconds): 0.14 Percent of CPU this job got: 80% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.97 Average shared text size (kbytes): 0 Average unshared data size (kbytes): 0 Average stack size (kbytes): 0 Average total size (kbytes): 0 Maximum resident set size (kbytes): 18660 Average resident set size (kbytes): 0 Major (requiring I/O) page faults: 0 Minor (reclaiming a frame) page faults: 5149 Voluntary context switches: 24 Involuntary context switches: 5 Swaps: 0 File system inputs: 0 File system outputs: 0 Socket messages sent: 0 Socket messages received: 0 Signals delivered: 0 Page size (bytes): 4096 Exit status: 0 ``` |
||
---|---|---|
.. | ||
nu_plugin_chart | ||
nu_plugin_example | ||
nu_plugin_from_bson | ||
nu_plugin_from_mp4 | ||
nu_plugin_from_sqlite | ||
nu_plugin_gstat | ||
nu_plugin_inc | ||
nu_plugin_match | ||
nu_plugin_python | ||
nu_plugin_query | ||
nu_plugin_s3 | ||
nu_plugin_start | ||
nu_plugin_to_bson | ||
nu_plugin_to_sqlite | ||
nu_plugin_tree | ||
nu-ansi-term | ||
nu-cli | ||
nu-color-config | ||
nu-command | ||
nu-engine | ||
nu-json | ||
nu-parser | ||
nu-path | ||
nu-plugin | ||
nu-pretty-hex | ||
nu-protocol | ||
nu-system | ||
nu-table | ||
nu-term-grid | ||
nu-test-support | ||
README.md |
Nushell core libraries and plugins
These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.
Foundational libraries are split into two kinds of crates:
- Core crates - those crates that work together to build the Nushell language engine
- Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.
Plugins are likewise also split into two types:
- Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
- Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.