Skip to content

Conversation

@cyqsimon
Copy link
Contributor

@cyqsimon cyqsimon commented Jan 22, 2024

This is an exploratory implementation of this idea.

As mentioned in that thread, it is possible that this change brings about no performance improvements at all, hence "exploratory". However, it is likely that as the mapping rule list grows, the benefits of leveraging multiple threads will (eventually, if we ever get there) start to outweigh the cost of spawning them.

Checklist

  • Implementation
  • Tests

@cyqsimon
Copy link
Contributor Author

I benchmarked this against master (2086cd2) with the following command after minimising the noise on my system:

hyperfine \
  --shell=none \
  --warmup=500 \
  --runs=5000 \
  -L version master,offload \
  --export-json=indeterminant.json \
  'target/release/bat-{version} --no-config --color=always tests/benchmarks/startup-time-src/mystery-file'

whisker plot

indeterminant.json.gz

It does indeed seem like it's slightly slower than master in its current state, although I do believe the implementation can be improved quite a bit.

This is an initial implementation
@cyqsimon
Copy link
Contributor Author

Closing in favour of v2.

@cyqsimon cyqsimon closed this Feb 21, 2024
@hamirmahal
Copy link
Contributor

I benchmarked this against master (2086cd2) with the following command after minimising the noise on my system:

hyperfine \
  --shell=none \
  --warmup=500 \
  --runs=5000 \
  -L version master,offload \
  --export-json=indeterminant.json \
  'target/release/bat-{version} --no-config --color=always tests/benchmarks/startup-time-src/mystery-file'

whisker plot

indeterminant.json.gz

It does indeed seem like it's slightly slower than master in its current state, although I do believe the implementation can be improved quite a bit.

Out of curiosity, how did you get that really nice graphic?

@hamirmahal
Copy link
Contributor

$  hyperfine 'node e'
Benchmark 1: node e
  Time (mean ± σ):      23.4 ms ±   1.1 ms    [User: 17.6 ms, System: 7.2 ms]
  Range (min … max):    22.1 ms …  31.5 ms    120 runs

is the most I was able to get working.

@cyqsimon
Copy link
Contributor Author

Out of curiosity, how did you get that really nice graphic?

plot_whisker.py

If you're on Arch Linux and friends, it comes with the hyperfine package at /usr/lib/hyperfine/scripts/plot_whisker.py .

@cyqsimon cyqsimon deleted the builtin-offload branch March 10, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants