speculative

https://github.com/borkdude/speculative
borkdude 2018-11-06T10:24:47.013700Z

You might want to disable your ad-blocker

borkdude 2018-11-06T10:28:19.014Z

@bbrinck ^

borkdude 2018-11-06T10:49:12.014900Z

I might give it a try later. Work is calling

borkdude 2018-11-06T16:25:12.017300Z

https://gist.github.com/borkdude/8a977fa453c6ee26fefcecb4c88fe1f2 I want to include one more dimension: usefulness. So if a spec isn’t going to find bad input, it’s not useful to instrument.

borkdude 2018-11-06T16:25:13.017400Z

mfikes 2018-11-06T17:10:31.019Z

Did you have any thoughts on disabling certain specs for people using 1.10.439? I just tried speculative in my project and immediately got “Maximum call stack size exceeded.”

borkdude 2018-11-06T18:27:11.019500Z

@mfikes afaik apply is the only spec that does that. the rest just slows stuff down (see the above link).

borkdude 2018-11-06T18:27:36.020Z

apply may be fundamentally un-instrumentable in cljs. but I can live with that

mfikes 2018-11-06T18:28:09.020600Z

Yeah. I’m just wondering if speculative is usable by anyone currently. I suppose it really depends on what your app does.

mfikes 2018-11-06T18:28:29.020900Z

(For ClojureScript apps, at least.)

borkdude 2018-11-06T18:29:34.021800Z

that’s what I’m trying to solve with the above penalty thing: to make it usable for developers by only enabling certain specs

mfikes 2018-11-06T18:30:01.022600Z

I don’t mean usable in terms of perf. I mean show-stopper, I can’t even start my app, sort-of thing.

borkdude 2018-11-06T18:30:34.023Z

apply is the only show-stopper I think. comment out that one and try it again?

borkdude 2018-11-06T18:30:57.023500Z

funny enough I can instrument apply in self-hosted cljs in Klipse (see earlier today)

borkdude 2018-11-06T18:32:19.023800Z

calling (stest/instrument) in Klipse gives an analysis error

borkdude 2018-11-06T18:33:11.024Z

apply does work for clojure itself, not cljs

mfikes 2018-11-06T18:45:16.024500Z

Yeah, you definitely want to enable speculative after your app is up and running

mfikes 2018-11-06T18:45:22.024700Z

Especially on an iOS device

borkdude 2018-11-06T21:06:29.025800Z

Our web app (client + server) becomes noticeably slower when instrumenting everything even after startup. That’s why I’m thinking of a “dev” profile using the above scores

borkdude 2018-11-06T21:17:51.026900Z

@mfikes I notice our tests also pass without including the “workaround” in core, so I moved it to the test deps. Also I moved Clojure there, so users can decide what version of Clojure they want to bring. If you’re ok with this, I’ll merge.

borkdude 2018-11-06T21:17:56.027100Z

https://github.com/slipset/speculative/pull/83

borkdude 2018-11-06T21:18:10.027400Z

Users can opt-in in the “workarounds” lib if they want. And with that in place, our deploy is fixed as well.

mfikes 2018-11-06T21:20:10.027800Z

Sounds good to me

borkdude 2018-11-06T22:10:19.028300Z

@slipset what’s the current way of deploying: is every merge to master deployed, or only when you push to master?

slipset 2018-11-06T22:12:04.029300Z

every merge to master is (should be) pushed to clojars as a snapshot-release

borkdude 2018-11-06T22:12:28.030100Z

ok thanks. I want to test if speculative is usable and I think so now.

borkdude 2018-11-06T22:12:41.030700Z

when depending on it via a mvn/version

slipset 2018-11-06T22:12:56.031Z

If we want to do a proper “release”, eg one without “-SNAPSHOT”, I might just have to do it manually from my computer.

slipset 2018-11-06T22:13:37.031200Z

hmm, maybe not.

borkdude 2018-11-06T22:13:56.031500Z

maybe put a println in that script to check 😉

slipset 2018-11-06T22:15:02.031800Z

#!/bin/bash -eo pipefail
.circleci/maybe-deploy.sh
Skipped command Created /home/circleci/repo/target/speculative-0.0.2-SNAPSHOT.jar
Wrote /home/circleci/repo/pom.xml
Retrieving speculative/speculative/0.0.2-SNAPSHOT/maven-metadata.xml 
    from <https://clojars.org/repo/>
Sending speculative/speculative/0.0.2-SNAPSHOT/speculative-0.0.2-20181106.212336-164.jar (12k)
    to <https://clojars.org/repo/>
Sending speculative/speculative/0.0.2-SNAPSHOT/speculative-0.0.2-20181106.212336-164.pom (3k)
    to <https://clojars.org/repo/>
Retrieving speculative/speculative/maven-metadata.xml 
    from <https://clojars.org/repo/>
Sending speculative/speculative/0.0.2-SNAPSHOT/maven-metadata.xml (1k)
    to <https://clojars.org/repo/>
Sending speculative/speculative/maven-metadata.xml (1k)
    to <https://clojars.org/repo/>

borkdude 2018-11-06T22:15:17.032Z

ah, alrighty

slipset 2018-11-06T22:15:28.032300Z

so it seems like it sends it there…

borkdude 2018-11-06T22:15:33.032600Z

good, thanks

slipset 2018-11-06T22:16:18.033200Z

yes, https://github.com/slipset/speculative/commit/8cf4f60cdf151a40f5c21ebf089bee17da38675f is the latest commit reported by clojars on 0.0.2-SNAPSHOT

borkdude 2018-11-06T22:16:34.033400Z

yep, then it’s working as it should