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

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,

[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

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

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

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: >