On 12/04/2013 03:36 PM, Bill Myers wrote:
Hello, I already implemented a persistent tree-map called SnapMap: you
can find the source code at https://github.com/mozilla/rust/pull/9816

I stopped working on it before I made a serious effort to push it into
the Rust codebase and don't have time to work further on it, so it would
be awesome if you were interested in continuing that effort.

It's pretty much finished, but pretty much completely untested (however,
it was derived from the existing treemap, so the amount of bugs should
not be as high as something written from scratch and untested).

The first thing that needs to be done is to run the existing tests
inherited from treemap, fix any bug that shows up, and then write more
tests to test SnapMap specific usage patterns and features.

Yay! Looks like I should start by collecting the various existing persistent structures (your SnapMap, Michael's HAMT, extra::list) and polishing them up.

Then, one should look at the mutable/handle-based iterators in the code
and decide whether they should be removed, kept as is, or improved,
possibly after changing the iterator interface to return an object with
the lifetime of the function call instead of the iterator.

The rest of the code should be fine (except for bugs due to no testing),
but there might be places where unnecessary copy-on-write is performed.

My code used an improved version of Rc that supports copy-on-write by
cloning only when reference count > 1.

Did COW improve performance? What's a good way to do performance testing of Rust code?

Should I try to get your patches to Rc and Arc merged? They look generally useful, if folks think they fit the design of Rc. You also have a patch that adds Own<T> to std which is equivalent to ~T but has methods that look like Rc's. You use this, and putting most of your treemap.rs inside macro definitions, to get a sort of reference-type-polymorphism in your treemap. Shall I continue with this approach and try to get Own<T> merged too? (Opinions from anybody are welcome.)

(I used https://github.com/mozilla/rust/pull/9816/files + click "Show Diff Stats" to look through the changes)

-Isaac

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to