Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is is possible to make this faster? #23

Open
samedhi opened this issue Oct 3, 2013 · 3 comments
Open

Is is possible to make this faster? #23

samedhi opened this issue Oct 3, 2013 · 3 comments

Comments

@samedhi
Copy link

samedhi commented Oct 3, 2013

This isn't so much a problem, but just a open ended question. Adding the cljx hook to my project adds about 4-5 seconds to my "lein test" task.

Don't get me wrong, I appreciate what cljx is doing for me. I was just wondering if there was some way (documented or otherwise) to get cljx to either:

  1. Just run a lot faster
  2. Only run if the source (cljx) file is newer than the derived (clj or cljs) file
  3. Do something else to achieve the same effect.
@cemerick
Copy link
Collaborator

cemerick commented Oct 3, 2013

(2) is the most obvious first step; a patch to implement that should be pretty straightforward, a good first contribution from anyone interested. ;-)

Nothing in the "stack" cljx is using (i.e. sjacket), or anything cljx itself is doing with it has seen much of any optimization AFAIK, so there's surely some gains to be made. TBH, optimizations are going to be on the back burner for me until certain key features are complete (esp. loading of required namespaces written in cljx). If anyone wants to dig into that though, feel free.

@samedhi
Copy link
Author

samedhi commented Oct 3, 2013

I don't really know how :hooks or nrepl middelware really work. Does cljx spin up a second jvm when it runs, or is it running "inside" another jvm process. Basically, am I paying the cost of having a jvm spun up or is it just running within another lein task?

Yes, the loading thing would be awesome. Currently I write in cljx, watch it compile, and then switch over to the generated clj file and load that using Ctrl-c Ctrl-k.

@cemerick
Copy link
Collaborator

cemerick commented Oct 3, 2013

If you're using nREPL, then I strongly suggest using the cljx middleware (see the README). As long as your nREPL client (nrepl.el?) is sending the filename as it should for eval and load-file operations, the middleware will perform the cljx preprocessing automatically, and way faster. If you're using cljx once, then that should be running within Leiningen's process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants