Fork me on GitHub
#clojure-survey
<
2020-01-07
>
borkdude16:01:56

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.

🎉 4
Olical16:01:10

Thanks for the nod! :)

seancorfield17:01:06

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 🙂

ghadi17:01:28

@seancorfield whoa how did you convince @hiredman troll ?

seancorfield17:01:51

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.

seancorfield17:01:23

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

ghadi17:01:06

can I ask what your startup times are roughly?

seancorfield17:01:31

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.

ghadi17:01:06

NR agent is a beast, too 🙂

ghadi17:01:20

thanks, this is useful info!

seancorfield17:01:43

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.

seancorfield17:01:19

We'll see whether it impacts debugging etc.

nate17:01:14

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

andy.fingerhut17:01:56

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

andy.fingerhut17:01:37

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

😆 1
seancorfield18:01:43

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.

ghadi18:01:47

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

seancorfield18:01:11

Yes, for almost all our services.

ghadi18:01:43

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

seancorfield18:01:08

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

seancorfield18:01:09

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

ghadi18:01:27

(thanks for fielding all the q's)

seancorfield18:01:23

That's on Adopt OpenJDK 11.0.5

seancorfield18:01:50

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

seancorfield18:01:10

Feel free to DM for more details if you want 🙂

borkdude17:01:03

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?

borkdude17:01:16

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

sogaiu17:01:10

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

Alex Miller (Clojure team)18:01:19

You can skip any question

ghadi17:01:21

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

ghadi17:01:59

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

borkdude17:01:22

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

seancorfield17:01:20

@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 @U050ECB92

seancorfield17:01:01

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

seancorfield17:01:16

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

borkdude17:01:32

sorry for not being clear

ghadi17:01:00

ah I see the two options now