Fork me on GitHub
#clj-kondo
<
2020-11-07
>
borkdude11:11:38

@dominicm I implemented .jar caching on master

dominicm11:11:46

@borkdude Ooh 😁 Do you generate a master build anywhere?

borkdude11:11:14

I will release a new version now

dominicm12:11:23

Nice, I'll give that a go now. I'm currently working on the tool I was using this for :) Will give you some measures. This is one of the times where having an FX8350 is valuable - testing worst case performance.

dominicm12:11:25

@borkdude I'm not seeing any speedup.

borkdude12:11:35

@dominicm How are you linting

borkdude12:11:49

You should explicitly use --no-warnings

borkdude12:11:41

If you are not seeing messages about skipped jars, it doesn't

dominicm12:11:41

@borkdude That made a difference. What does --no-warnings do?

dominicm12:11:30

Is that a new flag?

borkdude12:11:37

Yes. > The --no-warnings flag indicates that clj-kondo is used to analyze sources to populate the cache. When enabled, clj-kondo will suppress warnings, skips over already linted .jar files and copies configuration from dependencies into the .clj-kondo directory (see config.md).

dominicm12:11:14

Hmm... I don't suppose older versions of clj-kondo would just ignore that flag?

dominicm12:11:28

Ooh. Wonderful :)

dominicm12:11:58

Working wonderfully.

dominicm12:11:54

Deleting lots of code, great :). On older kondos it'll hang around longer, but that's fine.

dominicm12:11:08

Not much reason to not upgrade really, and I have a total of 0 users.

dominicm12:11:27

I just noticed that clj-kondo doesn't warn on use of _ symbols. Surprised

borkdude12:11:06

There's an issue for that. Recently mentioned in this channel.

borkdude12:11:49

Here's the official announcement then. Clj-kondo v2020.11.07 New: - deps.edn linting - import configs from deps - skip over already linted .jar files and more! Release notes: https://github.com/borkdude/clj-kondo/blob/master/CHANGELOG.md#v20201107 This release is funded by @cljtogether!

dominicm12:11:00

❯ clj -M:dev                                                     
Clojure 1.10.1
user=> "Elapsed time: 22009.876941 msecs"

❯ clj -M:dev
Clojure 1.10.1
user=> "Elapsed time: 607.153635 msecs"

❯ clj -M:dev
Clojure 1.10.1
user=> "Elapsed time: 574.688497 msecs"
Not bad :) I wonder where those last 600msecs are going.

borkdude12:11:39

Probably linting src and test maybe?

dominicm12:11:01

They are tiny. Total of 52 loc

borkdude12:11:37

$ time clj-kondo --no-warnings --lint $(clojure -Spath -Sdeps '{:paths []}') --parallel
sci-0.1.0.jar was already linted, skipping
cheshire-5.10.0.jar was already linted, skipping
transit-clj-1.0.324.jar was already linted, skipping
datalog-parser-0.1.7.jar was already linted, skipping
bencode-1.1.0.jar was already linted, skipping
clojure-1.10.1.jar was already linted, skipping
edamame-0.0.11-alpha.12.jar was already linted, skipping
sci.impl.reflector-0.0.1.jar was already linted, skipping
tools.reader-1.3.2.jar was already linted, skipping
jackson-core-2.10.2.jar was already linted, skipping
jackson-dataformat-cbor-2.10.2.jar was already linted, skipping
jackson-dataformat-smile-2.10.2.jar was already linted, skipping
tigris-0.1.2.jar was already linted, skipping
transit-java-1.0.343.jar was already linted, skipping
core.specs.alpha-0.2.44.jar was already linted, skipping
spec.alpha-0.2.176.jar was already linted, skipping
commons-codec-1.10.jar was already linted, skipping
jaxb-api-2.3.0.jar was already linted, skipping
msgpack-0.6.12.jar was already linted, skipping
json-simple-1.1.1.jar was already linted, skipping
javassist-3.18.1-GA.jar was already linted, skipping
clj-kondo --no-warnings --lint $(clojure -Spath -Sdeps '{:paths []}')    0.01s  user 0.01s system 95% cpu 0.022 total

borkdude12:11:51

22 ms when linting only jars

dominicm12:11:43

Linting only jars for me is 100ms :)

borkdude12:11:09

not bad either

dominicm12:11:11

But it's definitely not 500ms on src, so must be something else.

borkdude12:11:28

if you can repro anything weird with only clj-kondo, I will take a look

dominicm12:11:01

I think it might be a simple 500ms overhead to http://clojure.java.sh/sh... I'm... surprised

borkdude12:11:57

that would surprise me.

borkdude12:11:15

maybe you need to do shutdown-agents

dominicm12:11:28

I was being dumb, didn't activate the :dev alias when testing on the CLI.

dominicm12:11:17

tools.deps.alpha takes ~400ms to lint.

dominicm12:11:43

Maybe I'll try filtering to jars.

borkdude12:11:59

Ah and this is a git lib right

borkdude12:11:22

I'm considering to extend this optimization to git libs but I just wanted to get this out first

borkdude12:11:52

Feel free to make an issue

dominicm13:11:58

I think this is sensible for now, yeah :)

dominicm12:11:52

Oh nice, deps configs landed. That's awesome, I can remove that from the template too then. This makes my auto-run particularly convenient, as it'll automatically react to the inclusion of new deps on the classpath.

borkdude14:11:53

Btw, you may have to update flycheck-clj-kondo if you are using emacs integration if you want to get deps.edn linting.