<div dir="ltr"><div>Oh ok. I was under the impression maps have sorted keys.<br><br><br></div>Sergej<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 29, 2015 at 10:32 AM, zxq9 <span dir="ltr"><<a href="mailto:zxq9@zxq9.com" target="_blank">zxq9@zxq9.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tuesday 29 September 2015 10:12:55 Sergej Jurečko wrote:<br>
> Something like gb_trees:iterator_from<br>
> If you're traversing the entire map then to_list is fine (which fold,map<br>
> use). But if you wish to only traverse a subset of k/v pairs in a large map<br>
> it is quite wasteful.<br>
<br>
</span>Map keys are unordered. GB tree keys are ordered.<br>
<br>
If you are using maps then something like iterator_from already does not fit. But maybe you have some subset of keys you want to traverse? That is what maps:with/2 and maps:without/2 are for. (I have no idea how efficient with/2 or without/2 are in gigantic maps in R18 -- but I imagine these are the functions that will be optimized to death eventually if anything is, so it is what I would write code against today. Unless you actually do just need gb_trees...)<br>
<br>
In some cases having maps:partition/2 would be nice, but there are no cases I can think of where an equivalent to iterator_from makes sense without either requiring a filter over the entire map's values to figure out what subset you want, or already having a sublist of keys you want to include or exclude from your traversal.<br>
<br>
What am I missing?<br>
<br>
-Craig<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div>