hostctl icon indicating copy to clipboard operation
hostctl copied to clipboard

Extremely slow for large files

Open Nudin opened this issue 2 years ago • 2 comments

Describe the bug I tried to use the hosts file from StevenBlack with hostctl. When importing it, it takes 16 minutes.

To Reproduce Steps to reproduce the behavior:

curl https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts > hosts.adblock
sudo hostctl -q add adblock --from hosts.adblock

Expected behavior I expected it to be imported in a number of seconds.

System (please complete the following information):

  • OS: Linux
  • Version: latest Arch

Nudin avatar Jun 22 '22 10:06 Nudin

After importing this, all operations take that long…

Nudin avatar Jun 22 '22 10:06 Nudin

Hi @Nudin the file is 3.25Mb of entries. This tool may no be the best for this task, as it is parsing the whole file each time you run a command. It'll need to be re-written entirely to handle that kind of content.

guumaster avatar Jun 22 '22 14:06 guumaster