jsdelivr / globalping-cli

A simple CLI tool to run networking commands remotely from hundreds of globally distributed servers
Mozilla Public License 2.0
129 stars 14 forks source link

Fix liveview performance #68

Closed MartinKolarik closed 1 year ago

MartinKolarik commented 1 year ago

Unfortunately, the changes in https://github.com/jsdelivr/globalping-cli/pull/67 made the CLI extremely slow.

Before:

$ time go run main.go http https://www.jsdelivr.com --from Prague --full
real    0m1.329s
user    0m0.372s
sys     0m0.118s

After:

$ time go run main.go http https://www.jsdelivr.com --from Prague --full
real    0m5.059s
user    0m4.163s
sys     0m0.174s

The difference is clearly noticeable and reproducible when switching between ac64ed505f00f9dd374b6b234ea3bedd8463452d and 82a515482980685d8089bc75eb58b37893b720a7 revisions. From the diff, this line seems most suspicious: https://github.com/jsdelivr/globalping-cli/pull/67/files#diff-a11c808cf8905bf8e77f93433ad981e30426c8716b5f8854b1e2f6066adfab7fR47