clj-kondo

https://github.com/clj-kondo/clj-kondo
borkdude 2020-11-07T11:21:38.395100Z

@dominicm I implemented .jar caching on master

dominicm 2020-11-07T11:56:46.395200Z

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

borkdude 2020-11-07T11:57:14.395400Z

I will release a new version now

borkdude 2020-11-07T12:03:51.395600Z

Released.

dominicm 2020-11-07T12:06:23.395700Z

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.

dominicm 2020-11-07T12:19:25.395800Z

@borkdude I'm not seeing any speedup.

borkdude 2020-11-07T12:19:35.396Z

@dominicm How are you linting

borkdude 2020-11-07T12:19:49.396300Z

You should explicitly use --no-warnings

borkdude 2020-11-07T12:20:41.396700Z

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

dominicm 2020-11-07T12:20:41.396800Z

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

borkdude 2020-11-07T12:21:14.397100Z

@dominicm I updated the README for that here: https://github.com/borkdude/clj-kondo/#project-setup

dominicm 2020-11-07T12:21:30.397200Z

Is that a new flag?

borkdude 2020-11-07T12:21:37.397600Z

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).

dominicm 2020-11-07T12:22:14.397700Z

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

borkdude 2020-11-07T12:22:21.397900Z

they will

dominicm 2020-11-07T12:22:28.398Z

Ooh. Wonderful :)

dominicm 2020-11-07T12:23:58.398100Z

Working wonderfully.

dominicm 2020-11-07T12:25:54.398200Z

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

dominicm 2020-11-07T12:26:08.398300Z

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

dominicm 2020-11-07T12:27:27.398500Z

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

borkdude 2020-11-07T12:27:49.399Z

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!

borkdude 2020-11-07T12:28:06.399300Z

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

dominicm 2020-11-07T12:28:52.399500Z

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.

dominicm 2020-11-07T12:36:00.399700Z

❯ 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.

borkdude 2020-11-07T12:36:39.399900Z

Probably linting src and test maybe?

dominicm 2020-11-07T12:37:01.400100Z

They are tiny. Total of 52 loc

borkdude 2020-11-07T12:38:37.400300Z

$ 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

borkdude 2020-11-07T12:38:51.400500Z

22 ms when linting only jars

dominicm 2020-11-07T12:39:43.400700Z

Linting only jars for me is 100ms :)

borkdude 2020-11-07T12:40:09.400900Z

not bad either

dominicm 2020-11-07T12:40:11.401100Z

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

borkdude 2020-11-07T12:40:28.401300Z

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

dominicm 2020-11-07T12:42:01.401500Z

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

borkdude 2020-11-07T12:42:57.401700Z

that would surprise me.

borkdude 2020-11-07T12:43:15.401900Z

maybe you need to do shutdown-agents

dominicm 2020-11-07T12:46:28.402100Z

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

dominicm 2020-11-07T12:48:17.402300Z

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

dominicm 2020-11-07T12:50:43.402500Z

Maybe I'll try filtering to jars.

borkdude 2020-11-07T12:54:59.402700Z

Ah and this is a git lib right

borkdude 2020-11-07T12:55:22.402900Z

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

borkdude 2020-11-07T12:55:52.403100Z

Feel free to make an issue

dominicm 2020-11-07T13:19:58.403300Z

I think this is sensible for now, yeah :)

borkdude 2020-11-07T14:31:53.403700Z

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