Fork me on GitHub
#clojure
<
2024-03-14
>
Noah Bogart13:03:34

how do people compare performance increases/decreases across time/versions? i have a library that i'm considering changing with some speed decreases and i want to be able to see across time how i've gained/lost performance to know what the best way to go is

👍 1
p-himik13:03:02

Don't know the actual answer but there are GitHub bots/actions/whatever that compare difference in test coverage. Perhaps something like that exists for performance, or can be adapted to it.

Ben Sless13:03:31

First you need a performance regression suite You want to make sure it runs reliably in the same environment every time (sometimes a run matrix, CPU, OS, JVM version) and compare results every commit

Noah Bogart15:03:12

running in CI is good. I'll have to look around to see if anyone's doing this in clojure already

kwladyka19:03:52

third party tools like which track time of running functions (for example NewRelic). tests (to build confidence) but for real in production: • compare A vs B • or with bigger scale run N k8s pods (instances) with ver A and 1 with version B (canary) Depends how difficult is to make performance tests, but sometimes it is impossible to reconstruct production in full scale.

Noah Bogart19:03:31

this is for a cli app/library i develop, so no deployment, just running from the terminal

kwladyka19:03:32

but in general third party tool and wrap fn which you are interested in to measure that

kwladyka19:03:05

Do you use this library somehwere?

kwladyka19:03:32

I mean for real, not only for developing purpose and experimenting

Noah Bogart19:03:31

it's a static analysis/linting library, so no

kwladyka19:03:05

then make good tests, it should be achievable to do good performance tests for this

kwladyka19:03:31

you can make test to fail if take more, than X

kwladyka19:03:46

or something like that

kwladyka19:03:38

with repeat N times if fail

kwladyka19:03:19

or get conclusions manually from some output

Ben Sless06:03:56

If you want to test CLI invocation e2e use hyperfine For specific functions I'd use jmh

James Amberger13:03:24

Hello. I am writing an application for use at a pub. Barcode scanners are used to work up a bill, identify the customer, and generate a ledger entry. The logic is simple and written already with core.async, so the I/O is replaceable. Input layer for the finished product should be straightforward, but in the meantime I want to write a demo where the user input is mouse clicks. I’m picturing a crude drawing of a bar scene with clickable zones. Doesn’t matter if it runs in the browser or elsewhere. I’m seeking advice on how to proceed, and for the sake of discussion what if I were/had a {2D,3D} artist and wanted to create an interface accordingly. If I were to proceed right now I imagine I would use SVG in the browser.

jpmonettas15:03:22

> image maps that is nice, I didn't knew about it

emccue15:03:27

Is this for real or just a demo app?

James Amberger18:03:27

The app will be real but the input layer is barcode scanners—no GUI needed. The demo input layer is mouse clicks

Tommi Martin13:03:51

Security related question for the senior clojure developers: Do you have tools or habbits you would recommend to use in tracking security releases. Personally I'm thinking of automating a clj-watson check. But are there other approaches you would recommend?

Tommi Martin14:03:06

Have you modified it to work with clojure or extended it with another system? the readme doesn't list clojure package support unless i'm completely blind

lukasz14:03:04

There's multiple layers to this, and you in a way have to workaround Clojure being a language that's not really supported by any security-related software out of the box, that said: • as part of my workflow, whenever dependencies change, a pom.xml is automatically updated and checked in - that works with GH's Dependabot • container image scans are useful, but if you use the standard approach of including only the uberjar and the JDK in final build stage • something like Detectify to run periodical checks about web applications is quite useful • finally, nothing can really replace an annual pentest

1
ghaskins14:03:27

We didn’t modify it. It finds and checks jars in our uberjar. Perhaps to your point, it’s probably more apt to finding Java CVEs than clojure, but this is still helpful

👍 1
Tommi Martin14:03:51

Thank you both, you've given me something to think about and discuss upwards.

seancorfield16:03:07

We use clj-watson at work.

jussi10:03:53

Late to the party but we use https://github.com/rm-hull/nvd-clojure as a part of our build process.

danielneal21:03:09

If we upgrade java to 21, do we need to worry about the pinned threads issue? We’re using clojure 1.11..1 atm.

jgomez21:03:30

Just don’t use virtual threads, plenty of other positive gains to be gained by using java 21 considering, in my experience the transition was smooth once I stopped trying to make fibers work to solve a problem that I had solved with core async and thread pools

seancorfield21:03:15

We've had JDK 21 in production for a while (but we tend to update the JDK as each new version appears -- not just for LTS versions). We ran into a couple of memory leaks in JDK 19 and had to rollback to JDK 18 until JDK 20 came out with the fixes, but mostly it's all been smooth sailing. One gotcha is that if you build your uberjars on JDK 21, they may not run on JDK 20 or earlier due to a new interface added to the collection class hierarchy in Java 21, so beware of upgrading in the "usual" dev / CI / staging / production order (depending on where you build uberjars).

👍 1
danielneal21:03:20

Should we hold of until 1.12 comes out of alpha?

Alex Miller (Clojure team)21:03:21

depends heavily on what you're doing

Alex Miller (Clojure team)21:03:49

if you're not using virtual threads, then no difference

Alex Miller (Clojure team)21:03:46

even if you are using virtual threads, it's likely only an issue if you are passing unrealized seqs or delays that block for I/O

danielneal21:03:04

Does the issue only apply if we’re explicitly making use of virtual threads?

✔️ 3