Straight port of the Java code:

https://github.com/swannodette/persistent-vector/blob/master/persistent-vector.js

Some quick performance notes:

10-25X longer to build than JS Array (could be improved w/ transients)
5-6X slower to access than JS Array

But of course versus copy-on-write there's no competition:

http://jsperf.com/persistentvector-js/6

David

On Mon, Mar 5, 2012 at 11:10 AM, László Török <ltoro...@gmail.com> wrote:

> David,
>
> Was it a straight port of the jvm implementation?
> Is there any gist, blog post of your findings?
> Thx
> L
>
> sent from my mobile device
>
> On Mar 5, 2012 5:05 PM, "David Nolen" <dnolen.li...@gmail.com> wrote:
>
>> On Mon, Mar 5, 2012 at 10:55 AM, László Török <ltoro...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I may not be fully up to speed with the latest developments re.
>>> Clojurescript, so please bear with me.
>>>
>>> I was wondering, what are the impediments of implementing persistent
>>> data structures in Clojurescript similar to those Clojure already has?
>>> (and getting rid of the current copy-on-write whenever I create a new
>>> value out of an existing one)
>>>
>>> Thanks!
>>>
>>> --
>>> László Török
>>>
>>
>> We should definitely implement persistent data structures for
>> ClojureScript. I've done some initial tests and the modern JS engines seem
>> to handle them quite well. I think their performance will only continue ot
>> improve. If you've sent in your CA feel free to start on them and note your
>> progress on via tickets on JIRA :)
>>
>> David
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@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+unsubscr...@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 post to this group, send email to clojure@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+unsubscr...@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 post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to