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
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 ?
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)
Off the top of my head ā check out the new release and try setting :report-output to :repl
Didn't work for me, with every type of configuration I receive all kind of errors. It might just be too complicated built that makes it difficult, I should try simple electron project to check it.
https://clojurians.slack.com/archives/C06MAR553/p1543691655012600
@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?
also not a great idea to use memoize on a side-effecting body
seems like you probably want a more explicit cache, possibly with timestamp checks on the config file to decide to re-read it?
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.
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
okay, yeah, I'll definitely do some benchmarks, cause I don't have a great feeling about it either.
Thanks!
doing something like a simple throttle would be sufficientā¦load at most once every few seconds
that way it is never stale from one compile to the next, but prob only gets read once per compile
This sounds simple and effective, I like it.
so far so good on my portā¦working through incubator and adding >fdef
Great, let me know if anything blows up in unexpected places.
will doā¦so far it is working as expected, and Iāve been flexing it on tests to make sure it is catching things
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.
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
Thoughts?
I was working on this too š
If yours is better I'll take it š
I was just testing itā¦let me send a PR in a min
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ā¦.
basically checking the timestamp of the file
that has a little OS overhead, but no EDN parsing or file reading if the ts didnāt change
Iām out of time today, feel free to use it or not
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.
(and what the overall overhead of Ghostwheel is, general bottlenecks, etc.)
I'm done for today as well, let me know if anything else comes up. Thanks again for the feedback!
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ā¦
let me disable gw and see what happens
nvmā¦my bad