by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 26 2019 12:28
  • Jan 24 2019 03:01
    codecov[bot] commented #76
  • Jan 24 2019 02:58
    codecov[bot] commented #76
  • Jan 24 2019 02:58
    sharwell synchronize #76
  • Jan 23 2019 23:01

    sharwell on 1.0.0-alpha.74

    (compare)

  • Jan 23 2019 21:18

    sharwell on master

    Move immutable collections to T… Merge pull request #97 from sha… (compare)

  • Jan 23 2019 21:18
    sharwell closed #97
  • Jan 23 2019 21:18
    codecov[bot] commented #97
  • Jan 23 2019 21:18
    codecov[bot] commented #97
  • Jan 23 2019 21:17
    sharwell milestoned #96
  • Jan 23 2019 21:17
    sharwell milestoned #95
  • Jan 23 2019 21:17
    sharwell milestoned #94
  • Jan 23 2019 21:17
    sharwell milestoned #92
  • Jan 23 2019 21:16
    sharwell milestoned #97
  • Jan 23 2019 21:16
    sharwell demilestoned #97
  • Jan 23 2019 21:15
    sharwell milestoned #97
  • Jan 23 2019 21:15
    sharwell opened #97
  • Jan 23 2019 21:11

    sharwell on master

    Rename KeyOfPairComparer<TKey, … Extract helper KeyOfPairCompare… Implement ImmutableSortedTreeDi… and 2 more (compare)

  • Jan 23 2019 21:11
    sharwell closed #96
  • Jan 23 2019 21:08
    codecov[bot] commented #96
Big Jake
@jakesays
i have to re-learn it every time i do it
and that was a couple of weeks ago
Sam Harwell
@sharwell
cmd line feature is new. I haven't used it yet.
My workflow is to have a long-running branch in Git that holds the raw output of Sharpen. After regenerating, I merge that branch into master. That allows me to use Git for patching the Sharpen output instead of separately maintaining a patch file in source control.
Big Jake
@jakesays
so far i haven't needed to keep resharpening anything
well, i've only used it on one other project (smc)
and after it was c# i heavily modified it
but now i want to modify lucene.net's query parser
Sam Harwell
@sharwell
Wow I derailed this conversation fast
Big Jake
@jakesays
lol no prob
Sam Harwell
@sharwell
All I meant to say is I'm splitting time between this project and java-immutable, which is a port of System.Collections.Immutable to Java
The things you can do with that library are awesome.
Big Jake
@jakesays
immutable?
Sam Harwell
@sharwell
C#:
var dictionary = ImmutableDictionary<int, int>.Empty;
var updated = dictionary.SetItem(0, 0);
Assert.IsTrue(dictionary.IsEmpty);
Assert.IsFalse(updated.IsEmpty);
Assert.Equal(0, updated[0]);
Big Jake
@jakesays
ah yeah i havent had a chance to use it outside of roslyn
Sam Harwell
@sharwell
The great part is updates are O(log n)
Where I really want to use it is state management of an options dialog which has a Cancel button. I start with an ImmutableDictionary containing the application options, which is copied by reference. Settings made in the options dialog efficiently mutate the copy. If the user hits cancel, it simply discards the reference to the mutated copy. If they hit apply, it swaps the application's dictionary with the modified one.
This trees project should lay the foundation for implementing B+-tree backed data structures for that project
Sam Harwell
@sharwell
I'm interested in the following:
  1. B+-tree implementations to match Dictionary<TKey, TValue>, HashSet<T>, List<T>.
  2. B+-tree implementation to match ConcurrentDictionary<TKey, TValue>.
  3. B+-tree implementation to replace the AVL tree implementation in ImmutableList<T>, ImmutableDictionary<TKey, TValue>, ImmutableHashSet<T>, ImmutableSortedDictionary<TKey, TValue>, ImmutableSortedSet<T>
To date, I have implemented a B+-tree implementation which is close to what you'd see as ConcurrentHashSet<T>. Obviously by using a key-only equality comparer this could be reworked into a ConcurrentDictionary<TKey, TValue>. But there are nuances and major things to address in that implementation.
The two primary issues are:
  1. It was a (grad) school project. The assignment was to implement a particular interface, and that interface is not ISet<T>, so the implementation does not expose the right public API for long-term successful adoption.
  2. It uses a cleanup thread for periodic maintenance of the data structures. This would likely need to be changed to run the cleanup after every N mutations, or something like that.
I took the project seriously. It's implemented in both Java and C# with extensive tests, including passes through Chess
Sam Harwell
@sharwell
It obliterated the performance of Java's ConcurrentHashMap (Java 6), and performed equivalently to the rewritten ConcurrentHashMap (Java 7+). I don't remember .NET specifically but I believe it was roughly equivalent to ConcurrentDictionary.
I'm happy to open source it with the understanding that it needs to be modified before it's ready to be used/promoted
Big Jake
@jakesays
i'll be back in a bit - got sucked in to a sql emergency
Big Jake
@jakesays
@sharwell i'm back
Sam Harwell
@sharwell
Welcome back
Big Jake
@jakesays
@sharwell hey when were you planning on pushing the code?
Sam Harwell
@sharwell
That's a good question
Which code would you like to see?
Big Jake
@jakesays
the tree based collection stuff
Sam Harwell
@sharwell
:expressionless:
Alright, so I started an implementation of TreeList<T> that I'll push and create a pull request for
Big Jake
@jakesays
ok cool
Sam Harwell
@sharwell
I'm in the middle of implementing RemoveAt
Horácio Filho (Fofofly)
@horaciojcfilho
@jakesays I can
@jakesays Sorry, a type wrong :'(
Horácio Filho (Fofofly)
@horaciojcfilho
@sharwell I got to see your pull request, have you used a b+-tree implementation? What reference have you used for this (some document or sample code)? Great work :smile:
People, sorry sorry for my wrong messages, in my cellphone, sometimes, Gitter gets crazy :worried: , messages are send too early
Before I could type them completely
Horácio Filho (Fofofly)
@horaciojcfilho
@sharwell How will we do the benchmarks?
Sam Harwell
@sharwell
@horaciojcfilho I'm using my memory for a reference right now. Most of my benchmarks are centered around testing concurrent collections, but perhaps we could start with one of them in single-threaded mode?
Sam Harwell
@sharwell
I finally implemented TreeQueue<T> and TreeStack<T> (wrappers) plus ImmutableTreeList<T>, the first of the immutable collections.
initial performance testing suggests the new types substantially reduce allocations, but have not reached performance parity for speed.
I really need more scenarios to add to the benchmarks project though
Sam Harwell
@sharwell
Implemented ImmutableTreeQueue<T> and ImmutableTreeStack<T>, and am now finishing up the tests for ImmutableTreeSet<T>
That will leave ImmutableTreeDictionary<TKey, TValue>, ImmutableSortedTreeDictionary<TKey, TValue>, and ImmutableSortedTreeSet<T>
Mehran Mousavi
@mehran-mousavi
Hi Dear @sharwell , Is there any Documentation (Examples Or Anything related) for this library? I hit the #dotnet-trees ~Repository but i don't see anything related ! Would you please share Document or Examples link with me (of-course if exist) ?
I counting on your replay buddy.....
Best wishes...
Sam Harwell
@sharwell
From an API perspective, the types in this library work the same way as the types in the BCL (System.Collections.Generic or System.Collection.Immutable)