Re: [elixir-core:6896] Re: Sorting maps when inspecting

2017-02-15 Thread Onorio Catenacci
I'm assuming he means IO.inspect but I may be wrong. On Wed, Feb 15, 2017 at 4:37 PM, Robert Virding wrote: > How do you mean "when they are inspected"? If you do it then all functions > which step through the keys would have to be fixed and some like *fold* and > *map* could be very difficult t

[elixir-core:6895] Re: Sorting maps when inspecting

2017-02-15 Thread Robert Virding
How do you mean "when they are inspected"? If you do it then all functions which step through the keys would have to be fixed and some like *fold* and *map* could be very difficult to implement in an efficient manner. If you don't do it for all then it is pointless. Robert On Monday, 13 Febru

Re: [elixir-core:6894] Re: Sorting maps when inspecting

2017-02-15 Thread Dmitry Belyaev
If I dump a map to logs I don't care about its order, I only want it to be as fast as possible. Logging already introduces a serious performance hit, and sorting would make logging even more expensive performance wise. As was mentioned previously if a map is small it's already sorted. So it wou

Re: [elixir-core:6893] Re: Sorting maps when inspecting

2017-02-15 Thread Bruce Tate
Good points, but isn't inspecting a map generally a development time activity? Especially big maps? Sometimes, optimizing people is the right thing to do. When you're looking at big lists of ecto objects and working to pick out an ID, having things in order is a big deal. -bt On Wed, Feb 15, 20

Re: [elixir-core:6893] Re: Sorting maps when inspecting

2017-02-15 Thread Tallak Tveide
I believe it would be useful to not sort if there are very many keys as well. A huge map would presumably be inspected in a short while, skipping keys after the first few. Inspecting a huge map could become cpu/memory intensive, which I would find surprising... anyways +1 from me -- You recei

Re: [elixir-core:6891] Re: Sorting maps when inspecting

2017-02-15 Thread Amos King
I did read all of it before I commented. I'm not sure if I'm going to output a really large map that I want to wait for it to sort. I guess I might want to wait. It would depend on why I want to sort. I guess I need to look at how I usually use inspect. I normally know the keys I'm looking for a

Re: [elixir-core:6891] Re: Sorting maps when inspecting

2017-02-15 Thread Onorio Catenacci
Again, the question is the _display_ of the keys; absolutely nothing would change about how the keys are stored. "I propose always sorting the map keys *when they are inspected" *(emphasis mine). Please read back to the start of the thread if you care to comment. On Wednesday, February 15,

Re: [elixir-core:6889] Re: Sorting maps when inspecting

2017-02-15 Thread Louis Pilfold
Hey Amos As I understand it the ordering of maps is an Erlang implementation detail that is not to be relied upon. If you want an ordered dictionary a map probably is not the correct data structure for you. Cheers, Louis On Wed, 15 Feb 2017 at 14:35 Amos King wrote: > Before jumping on this s

Re: [elixir-core:6888] Re: Sorting maps when inspecting

2017-02-15 Thread Onorio Catenacci
Hi Amos, This is solely discussing the _display_ of the keys--not the storage. On Wed, Feb 15, 2017 at 9:35 AM, Amos King wrote: > Before jumping on this should we be asking why the decision was made to > not sort if there are more than 32 keys? Maybe there is a performance > concern, and if we

Re: [elixir-core:6887] Re: Sorting maps when inspecting

2017-02-15 Thread Amos King
Before jumping on this should we be asking why the decision was made to not sort if there are more than 32 keys? Maybe there is a performance concern, and if we want sorted keys we should be sending a different message? Amos King Owner Binary Noggin http://binarynoggin.com #business http://thisagi