ghostwheel

Hassle-free clojure.spec, automatic generative testing, side effect detection, and evaluation tracing for Clojure(-Script) – https://github.com/gnl/ghostwheel
Sen 2018-12-01T17:23:04.001700Z

I'm trying to add Ghostwheel to an electron project based on the leiningen template https://github.com/ducky427/electron-template/blob/master/README.md

Sen 2018-12-01T17:26:29.005700Z

However, I cannot figure out how to make it work, I don't see any messages in browser console, I tried to use cljs REPL but it still doesn't do anything. Did anyone have an experience of setting an electron clojurescript project adding Ghostwheel ?

gnl 2018-12-02T10:28:33.015400Z

Feel free to open an issue when you have a more concrete idea of where things are going wrong or specific errors (maybe with a repro repo)

👍 1
gnl 2018-12-01T19:17:10.006100Z

Off the top of my head – check out the new release and try setting :report-output to :repl

tony.kay 2018-12-01T20:43:59.007Z

@clojurians.net I think your use of memoize on line 109 of utils isn’t doing what you hope it is doing…isn’t env going to be different at every call site?

tony.kay 2018-12-01T20:44:45.007500Z

also not a great idea to use memoize on a side-effecting body

tony.kay 2018-12-01T20:45:50.008200Z

seems like you probably want a more explicit cache, possibly with timestamp checks on the config file to decide to re-read it?

gnl 2018-12-01T21:42:26.008500Z

Yup, I agree that it's probably not doing much, I was playing around trying to figure out whether it makes sense to optimise that part and how, but I didn't want to put too much time into it before looking into how significant the impact would be on compilation time so I kinda left it like that. And I'm aware that this really isn't what memoize is meant for. 🙂 I have to see if there's a performance impact and if there is, I don't know that it'll necessarily be because of the configuration file being reread repeatedly, because since that happens again and again in a very short period of time during compilation, I think chances are pretty good that any subsequent access during compilation will hit the filesystem cache. Will look into it, do some benchmarks and then see if it's something worth pursuing.

tony.kay 2018-12-01T21:43:20.008700Z

well, hitting the system call layer at all is a fair impact, and hitting it at every def in the entire program is probably significant

gnl 2018-12-01T21:44:15.008900Z

okay, yeah, I'll definitely do some benchmarks, cause I don't have a great feeling about it either.

gnl 2018-12-01T21:44:17.009100Z

Thanks!

tony.kay 2018-12-01T21:44:39.009300Z

doing something like a simple throttle would be sufficient…load at most once every few seconds

tony.kay 2018-12-01T21:45:05.009500Z

that way it is never stale from one compile to the next, but prob only gets read once per compile

gnl 2018-12-01T21:45:27.009700Z

This sounds simple and effective, I like it.

tony.kay 2018-12-01T21:45:43.009900Z

so far so good on my port…working through incubator and adding >fdef

gnl 2018-12-01T21:46:13.010100Z

Great, let me know if anything blows up in unexpected places.

tony.kay 2018-12-01T21:46:53.010300Z

will do…so far it is working as expected, and I’ve been flexing it on tests to make sure it is catching things

gnl 2018-12-01T21:47:40.010500Z

Nice. I've tested a lot and the test suite is fairly comprehensive, but it's a big release, something may have slipped through the cracks.

tony.kay 2018-12-01T22:09:20.011700Z

So, this might be related to gw…I don’t think it was happening before…The tests I’m running is using maps and a thing called a Reconciler…

tony.kay 2018-12-01T22:09:30.012Z

let me disable gw and see what happens

tony.kay 2018-12-01T22:11:16.012400Z

nvm…my bad

gnl 2018-12-01T22:40:53.012700Z

I'll do some benchmarking soon, but for now I just went ahead and did the simple cache: https://github.com/gnl/ghostwheel/commit/3db37e6204a88af782ee3da78153f3fdebe420bd

gnl 2018-12-01T22:41:02.012900Z

Thoughts?

tony.kay 2018-12-01T22:41:19.013100Z

I was working on this too 😜

gnl 2018-12-01T22:41:47.013300Z

If yours is better I'll take it 🙂

tony.kay 2018-12-01T22:42:07.013500Z

I was just testing it…let me send a PR in a min

👍 1
tony.kay 2018-12-01T22:47:50.013800Z

So, I sent a PR, but I’m not sure it is fully working…I was trying to output messages about reloads, but I think since this is running in macros that isn’t the best idea….

tony.kay 2018-12-01T22:48:01.014Z

basically checking the timestamp of the file

tony.kay 2018-12-01T22:48:19.014200Z

that has a little OS overhead, but no EDN parsing or file reading if the ts didn’t change

tony.kay 2018-12-01T22:48:29.014400Z

I’m out of time today, feel free to use it or not

gnl 2018-12-01T22:49:44.014600Z

Cool, thanks, I'll keep it open until I do the benchmarking, so we are not spending too much time poking blindly at the performance, and then I'll check which one's faster.

gnl 2018-12-01T22:50:36.014800Z

(and what the overall overhead of Ghostwheel is, general bottlenecks, etc.)

gnl 2018-12-01T22:52:48.015Z

I'm done for today as well, let me know if anything else comes up. Thanks again for the feedback!