guumaster / hostctl

Your dev tool to manage /etc/hosts like a pro!

Home Page:http://guumaster.github.io/hostctl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extremely slow for large files

Nudin opened this issue · 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

After importing this, all operations take that long…

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.