kcl-lang / kcl

KCL Programming Language (CNCF Sandbox Project). https://kcl-lang.io
https://kcl-lang.io
Apache License 2.0
1.67k stars 118 forks source link

KCL does "unnecessary" networking and slows down when ... #1347

Closed dennybaa closed 5 months ago

dennybaa commented 5 months ago

Hello @Peefy! I believe I hit an odd bug.

version: 0.8.8-linux-amd64

kcl.mod is at repo root. When we invoke kcl and don't hop over kcl.mod everything is fine:

time kcl -dY kcl.yaml ../../bootstrap.k
hello:
  world: 1234
kcl -dY kcl.yaml ../../bootstrap.k  0.05s user 0.03s system 35% cpu 0.234 total

If there's kcl.mod on the way, networking kicks, dns queries etc probably related to some module operations... Clearly seen from strace.

time kcl -dY kcl.yaml ../../../bootstrap.k
hello:
  world: 1234
kcl -dY kcl.yaml ../../../bootstrap.k  0.08s user 0.04s system 1% cpu 11.133 total

The path can actually be absolute, so it looks like it happens when we run into a module with remotes on the way to the code k file.

Thank you!

Peefy commented 5 months ago

Dup with https://github.com/kcl-lang/kpm/issues/328

dennybaa commented 5 months ago

it was moved) okay thank you. I thought i haven't posted)