Answering my question with potential blind spots: The time it takes to populate data into an immutable tree (say an interval tree data structure or whatever kind) and the cost of updates to that immutable structure may be higher than the cost of copying.
So I'm leaning toward the belief that immutable data structures help make concurrency simpler and easier to debug but they may actually be less performant than the mutable approach, and that's true either depending on the type of data structure or always... Have not done the detailed thinking or benchmarking... But I feel like I answered my own question in that immutability is simply a basic requirement for functional programming but while it makes concurrency easier even in single thread environments with async loops running concurrently the impact on performance is likely negative. If that's wrong or partly wrong conclusion I would love to hear it and have some examples. Thanks Marc Sent from my iPhone > On Feb 9, 2015, at 1:29 PM, Marc Fawzi <marc.fa...@gmail.com> wrote: > > by processes in my previous reply, I mean async data processing loops running > concurrently, i.e. a function called via setImmediate that keeps calling > itself, and where you can have multiple of those running concurrently and > operating on the same data structure.... In JS world, we'd make copies of the > data structure. In CLJS, there are immutable types and immutability is > achieved without cloning... so all I'm looking for is an example of using > immutability in CLJS as a performance advantage in such a scenario... is > there one? > >> On Mon, Feb 9, 2015 at 12:23 PM, Marc Fawzi <marc.fa...@gmail.com> wrote: >> right, concurrent, omitting the web worker stuff which relies on messaging, >> >> I see improvements to code clarity and maintainability with core.async but >> I'm trying to find if CLJS' immutable data structures give it a performance >> advantage where normally expensive copying/cloning would be required for >> isolating the working memory of two or more processes >> >> >>> On Mon, Feb 9, 2015 at 12:03 PM, Gary Trakhman <gary.trakh...@gmail.com> >>> wrote: >>> Core.async on clojurescript gives a huge advantage for concurrent data >>> processing, maybe not parallel. >>> >>>> On Mon Feb 09 2015 at 3:01:16 PM Marc Fawzi <marc.fa...@gmail.com> wrote: >>>> >>>> Potentially naive question, but I thought I should get it out of the way :) >>>> >>>> Since in Javascript, there are no threads with shared memory, is there any >>>> performance advantage to using CLJS (vs JS, or Immutable.js vs mutable >>>> data structures) when it comes to parallel data processing? If so, are >>>> there any example specific to CLJS? >>>> >>>> Curious. >>>> >>>> >>>> >>>> -- >>>> Note that posts from new members are moderated - please be patient with >>>> your first post. >>>> --- >>>> You received this message because you are subscribed to the Google Groups >>>> "ClojureScript" group. >>>> To unsubscribe from this group and stop receiving emails from it, send an >>>> email to clojurescript+unsubscr...@googlegroups.com. >>>> To post to this group, send email to clojurescript@googlegroups.com. >>>> Visit this group at http://groups.google.com/group/clojurescript. >>> >>> -- >>> Note that posts from new members are moderated - please be patient with >>> your first post. >>> --- >>> You received this message because you are subscribed to the Google Groups >>> "ClojureScript" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to clojurescript+unsubscr...@googlegroups.com. >>> To post to this group, send email to clojurescript@googlegroups.com. >>> Visit this group at http://groups.google.com/group/clojurescript. > -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.