Files
nushell/crates/nu-table
Maxim Zhiburt 71d78b41c4 nu-table: optimize table creation and width functions (#15900)
> Further tests are welcomed.

It was already implemented that we precalculate widths, but nothing
stops to do heights as well.
Because before all the calculus were wasted (literally).

It affects `table` and `table --expand`.
The only case when it does not work (even makes things slightly less
optimal in case of `table` when `truncation` is used)

Sadly my tests are not showing the clear benefit.
I have no idea why I was expecting something 😞 
But it must be there :)

Running `scope commands` + `$env.CMD_DURATION_MS`:

```log
# patch (release)
2355 2462 2210 2356 2303

# main (release)
2375 2240 2202 2297 2385
```

PS: as once mentioned all this stuff ought to be moved out `nu-table`

---------

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
2025-07-06 12:56:42 -05:00
..
2022-02-07 14:54:06 -05:00

The layout logic for Nushell's table viewer.

See also the separate table command implementation

Internal Nushell crate

This crate implements components of Nushell and is not designed to support plugin authors or other users directly.