clojure-survey

Discussion about the State of Clojure survey (https://surveymonkey.com/r/clojure2020)
borkdude 2020-01-07T16:07:56.190200Z

Done filling out the survey. I'm running CLJS tests with https://github.com/Olical/cljs-test-runner which was not there so I put it in other. But because it also uses doo I also marked that field.

🎉 1
Olical 2020-01-07T16:20:10.191400Z

Thanks for the nod! :)

seancorfield 2020-01-07T17:02:06.193400Z

After years of running our production apps with java clojure.main we have just, this week, switched to using java with AOT'd classes -- interesting to see a question about exactly that 🙂

ghadi 2020-01-07T17:03:28.194Z

@seancorfield whoa how did you convince @hiredman :troll: ?

seancorfield 2020-01-07T17:06:51.194800Z

Neither of us are thrilled about this change. And we're using it purely as the very last stage when building an uberjar, just to get service start up times down, so rolling deploys go faster.

seancorfield 2020-01-07T17:07:23.195Z

I've resisted even looking at AOT for start up times until after I added --compile to depstar 🙂

ghadi 2020-01-07T17:08:06.195200Z

can I ask what your startup times are roughly?

seancorfield 2020-01-07T17:10:31.195400Z

Before AOT, anything from 20 seconds to a minute and a half, depending on the service and what else the box is doing. After AOT, looks to be 5-10 seconds across the board. Still reviewing the improvement. And that's with New Relic's instrumentation agent doing its thing.

ghadi 2020-01-07T17:11:06.195600Z

NR agent is a beast, too 🙂

ghadi 2020-01-07T17:11:20.195800Z

thanks, this is useful info!

seancorfield 2020-01-07T17:11:43.196Z

Deployment artifacts increased in size by about 50%. And we still have a few things that we run with java -cp ... clojure.main but are also now much faster to start because nearly all "our" code is AOT'd.

seancorfield 2020-01-07T17:12:19.196200Z

We'll see whether it impacts debugging etc.

nate 2020-01-07T17:14:14.196400Z

oh this is great information, I need to update our depstar dep to the latest and try out the --compile flag, thanks @seancorfield!

borkdude 2020-01-07T17:17:03.197600Z

I wondered what this question meant exactly. Does it mean you have a :gen-class somewhere, build an uberjar and call it with java -jar for example?

borkdude 2020-01-07T17:17:16.198200Z

If that's it, I've never used java clojure.main, can't remember having done so

2020-01-07T17:18:10.199Z

too late for this perhaps, but for Q 22 would a column for "don't have an opinion" have made sense?

ghadi 2020-01-07T17:20:21.200100Z

@borkdude gen-class not necessary for clojure.main. Only a -main method java ..... clojure.main -m some.namespace

ghadi 2020-01-07T17:20:59.200700Z

(clojure.main is a java class, which is surprising because most classes are capitalized)

borkdude 2020-01-07T17:21:22.201200Z

I understand, but the other way "java with AOT'd classes" is what I asked about

borkdude 2020-01-07T17:21:32.201400Z

sorry for not being clear

ghadi 2020-01-07T17:22:00.202Z

ah I see the two options now

seancorfield 2020-01-07T17:36:20.202700Z

@borkdude Yes, we had to add (:gen-class) to twelve subprojects in our monorepo, and we added pom.xml (generated by clojure -Spom) as well, to trigger depstar's ability to create a manifest etc. /cc @ghadi

seancorfield 2020-01-07T17:38:01.202900Z

We have always run our production tasks with java -cp path/to/uber.jar clojure.main -m our.main.ns in the past (which still works with an AOT'd JAR).

seancorfield 2020-01-07T17:40:16.203100Z

We're switching to java -jar path/to/uber.jar for JARs that were AOT'd with a (:gen-class) shortly.

2020-01-07T17:57:56.203300Z

I suddenly feel as if up is down and left is right ... 🙂

2020-01-07T17:58:37.203500Z

Who are you and what have you done with the real Sean Corfield? 🙂

seancorfield 2020-01-07T18:25:43.203700Z

Where's my "side eye" emoji? 🙂 Yeah, like I said, neither of us are happy about making this change really. It makes the artifact build process a lot slower, and it makes the artifacts themselves a lot bigger, but it does have a worthwhile startup time improvement, as we've been working on streamlining that.

ghadi 2020-01-07T18:27:47.203900Z

5-10 seconds to startup now -- is that time-to-healthcheck passing?

seancorfield 2020-01-07T18:31:11.204100Z

Yes, for almost all our services.

ghadi 2020-01-07T18:31:43.204300Z

👍:skin-tone-4: do you track # of classes loaded?

seancorfield 2020-01-07T18:34:08.204500Z

Well, New Relic shows that metric but I wouldn't say we actively "track" it...

seancorfield 2020-01-07T18:35:09.204900Z

27,300 classes loaded right now, 3,430 unloaded, according to New Relic, on our main API service.

ghadi 2020-01-07T18:36:06.205100Z

Java 8?

ghadi 2020-01-07T18:36:27.205300Z

(thanks for fielding all the q's)

seancorfield 2020-01-07T18:38:23.205500Z

That's on Adopt OpenJDK 11.0.5

seancorfield 2020-01-07T18:38:50.205700Z

(we still have a few processes on Adopt OpenJDK 8u232 but those are mixed legacy technology)

seancorfield 2020-01-07T18:39:10.205900Z

Feel free to DM for more details if you want 🙂

alexmiller 2020-01-07T18:47:19.206300Z

You can skip any question

2020-01-07T23:52:18.206900Z

thanks