nushell/crates/nu-plugin
Devyn Cairns 0e36c43c64
Add BufWriter to ChildStdin on the plugin interface (#12419)
# Description
This speeds up writing messages to the plugin, because otherwise every
individual piece of the messages (not even the entire message) is
written with one syscall, leading to a lot of back and forth with the
kernel.

I learned this by running `strace` to debug something and saw a ton of
`write()` calls.

```nushell
# Before
1..10 | each { timeit { example seq 1 10000 | example sum } } | math avg
269ms 779µs 149ns
# After
> 1..10 | each { timeit { example seq 1 10000 | example sum } } | math avg
39ms 636µs 643ns
```

# User-Facing Changes
- Performance improvement

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`
2024-04-06 11:52:27 +08:00
..
src Add BufWriter to ChildStdin on the plugin interface (#12419) 2024-04-06 11:52:27 +08:00
Cargo.toml Bump version to 0.92.2 (#12402) 2024-04-05 10:24:00 -04:00
LICENSE Fix rest of license year ranges (#8727) 2023-04-04 09:03:29 +12:00
README.md Add test support crate for plugin developers (#12259) 2024-03-23 13:29:54 -05:00

nu-plugin

This crate provides the API for Nushell plugins. See the book for more information on how to get started.