Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow when jumping to end of long file #2218

Open
someonewithpc opened this issue Jun 9, 2022 · 3 comments
Open

Slow when jumping to end of long file #2218

someonewithpc opened this issue Jun 9, 2022 · 3 comments

Comments

@someonewithpc
Copy link

What steps will reproduce the bug?

  1. Open a long file
  2. Press Alt+>

What happens?

Long delay, and eventually it goes to the end of the file

What did you expect to happen instead?

A much shorter delay, like in less

How did you install bat?

Arch Linux AUR

bat version and environment

bat --diagnostic

Software version

bat 0.21.0 (405e5f7)

Operating system

Linux 5.18.1-arch1-1

Command-line

bat --diagnostic 

Environment variables

SHELL=/bin/bash
PAGER=<not set>
LESS=-asrRix8
LANG=en_US.UTF-8
LC_ALL=<not set>
BAT_PAGER=<not set>
BAT_CACHE_PATH=<not set>
BAT_CONFIG_PATH=<not set>
BAT_OPTS=<not set>
BAT_STYLE=<not set>
BAT_TABS=<not set>
BAT_THEME=<not set>
XDG_CONFIG_HOME=<not set>
XDG_CACHE_HOME=<not set>
COLORTERM=truecolor
NO_COLOR=<not set>
MANPAGER=<not set>

Config file

Could not read contents of '/home/hugo/.config/bat/config': No such file or directory (os error 2).

Custom assets metadata

Could not read contents of '/home/hugo/.cache/bat/metadata.yaml': No such file or directory (os error 2).

Custom assets

'/home/hugo/.cache/bat' not found

Compile time information

  • Profile: release
  • Target triple: x86_64-unknown-linux-gnu
  • Family: unix
  • OS: linux
  • Architecture: x86_64
  • Pointer width: 64
  • Endian: little
  • CPU features: fxsr,sse,sse2
  • Host: x86_64-unknown-linux-gnu

Less version

> less --version 
less 590 (PCRE2 regular expressions)
Copyright (C) 1984-2021  Mark Nudelman

less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Home page: https://greenwoodsoftware.com/less
@someonewithpc someonewithpc added the bug Something isn't working label Jun 9, 2022
@keith-hall keith-hall added performance and removed bug Something isn't working labels Jun 22, 2022
@sharkdp
Copy link
Owner

sharkdp commented Sep 6, 2022

Can you provide some more infos? Like what kind of file you were opening?

It is somewhat expected that bat performs worse than less, because it does additional work (syntax highlighting). And some of the syntaxes are rather slow.

@someonewithpc
Copy link
Author

Fair enough, but maybe it'd be possible to do the syntax highlighting after jumping, or something?

@sharkdp
Copy link
Owner

sharkdp commented Sep 6, 2022

Not as long as we rely on external pagers (like less), but potentially if #1053 ever becomes reality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants