--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
@garyv, I haven't tested/profiled in a really long time, but I recall the majority of startup time being spent in Class.forName.
I'm not sure how to verify startup exactly, but it should be easy to profile a top-level repl 'require' call from the user ns, which is doing essentially the same work, except it wouldn't show the difference between direct-linked code and nondirect, and you'd have to be careful to AOT your project so you're not just profiling the compiler.On Wed, Jan 24, 2018 at 8:39 AM Gary Verhaegen <gary.ve...@gmail.com> wrote:I've read a mot of discussions around that but have never myself looked into the details, so the following may be completely wrong.My understanding is slightly different: the JVM does not actually load a class before it is first accessed by running code. What takes a long time for the JVM and not for JS engines, I think, is not loading the code, but creating objects.For Clojure to run, all of your functions need to exist as objects in memory. Java bytecode does not have any mechanism to describe objects, so when Clojure starts up, it has to first load the code that defines the classes, then load the code that creates instances of those classes, and then execute that code to actually get the function objects. Only then can it start even thinking about looking at your own code. AOT thus just saves on parsing string files into Clojure lists, but it cannot really help with the problem that all of these objects still have to be created again from scratch at each start up.
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
It looks like clojure/core__init.load is the slowest bit with load and requiring spending the most time on, as well as loadClass, followed by clojure/lang/Var.invoke.
Wouldn't ClojureScript also need to initialize all Vars and execute top level forms? You'd think that part would be slower in JavaScript no?
The JVM is concurrent whereas Javascript VMs are singled-threaded. Var initialisation in Clojure uses concurrency primitives to ensure that namespaces are always consistent for all threads, whereas Clojurescript simply assigns to variables. Our profiling of Clojure on the JVM indicates that a lot of the time spent in namespace initialisation is spent in concurrency structures, and this seems much more significant for non-clojure-core namespaces.
On Fri, Jan 26, 2018 at 7:22 AM Mikhail Gusarov <dott...@dottedmag.net> wrote:
cljs vars are not reified.
On Thu, 25 Jan 2018, at 18:24, Didier wrote:
> Based on the profiling performed here
> http://clojure-goes-fast.com/blog/clojures-slow-start/ on 1.9,
>
> It looks like clojure/core__init.load is the slowest bit with load and
> requiring spending the most time on, as well as loadClass, followed by
> clojure/lang/Var.invoke.
>
> Wouldn't ClojureScript also need to initialize all Vars and execute top
> level forms? You'd think that part would be slower in JavaScript no?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to clojure+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
Really, any comparisons between JS and JVM startup times are not useful at all.
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to clojure+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
Nathan Fisher
--
a nitpick on point 1 - I would assume you can't expect hotspot to improve anything in the timescale of a program startup
For me, the slow startup isn't much of a bother for normal operations of my apps. They are generally long running services. But development is where I am bothered by it the most. It can be painful to restart a repl and it's very disruptive to my ability to stay focussed.
CRIU seems like it could actually help in this case. In particular, paired with Docker, I can just restart from a known good checkpoint with editor loaded, repl up and connected, etc. That would be very nice.
CRIU seems like it could actually help in this case. In particular, paired with Docker, I can just restart from a known good checkpoint with editor loaded, repl up and connected, etc. That would be very nice.