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, 2017 at 10:02:14 AM UTC-5, Louis Pilfold wrote:
>
> 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 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://thisagilelife.com #podcast
>>
>> ===
>> I welcome VSRE emails. Learn more at http://vsre.info/
>> ===
>>
>>
>> On Tue, Feb 14, 2017 at 7:41 PM, Ben Wilson > > wrote:
>>
>>> This has my vote as well. It would make visually inspecting maps a lot 
>>> easier.
>>>
>>> On Tuesday, February 14, 2017 at 7:36:05 PM UTC-5, Onorio Catenacci 
>>> wrote:

 +1 Eric 
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "elixir-lang-core" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to elixir-lang-co...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/elixir-lang-core/934ffbee-44a6-40fb-9ecf-e24d48624f3f%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to elixir-lang-co...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elixir-lang-core/CAJr6D4S81ZqQ%2BaZQrw_rohpPXxwBpUWz1WsAEUZ82fjT02U7Pg%40mail.gmail.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/968dfad6-6889-4975-a413-91bbc48968ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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, 2017 at 2:17 PM, Tallak Tveide  wrote:

> 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 received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/elixir-lang-core/8a1f314b-efdb-468d-8dae-
> ba6492aa0f95%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Bruce Tate
President, RapidRed, LLC
Phone: 512.772.4312
Fax: 512 857-0415

Author of Seven Languages in Seven Weeks, Deploying Rails Applications,
>From Java to Ruby, Rails: Up and Running, Beyond Java, 6 others.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAMp4_igDYoGoJFcM6B55cfjttcvZKaJ%3Dag8ksQQN-LtNGD2Nag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[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 February 2017 22:49:13 UTC+1, Eric Meadows-Jönsson wrote:
>
> Currently struct and map keys are in indeterminate order when they are 
> inspected. Due to implementation details in the VM maps that have <32 keys 
> are in term order but for larger maps and structs the order is random.
>
> I propose always sorting the map keys when they are inspected so that it's 
> easier to read and scan the results.
>
> -- 
> Eric Meadows-Jönsson
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/5e3f4e37-bb6c-4688-bb86-5d430e095726%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 would 
be a waste of time although insignificant. But if it's huge it would spend both 
cpu and memory to vuild sorted structure, and later would spend more cpu on its 
garbage collection. I don't like the idea of losing production performance only 
for development convenience. 

On 16 February 2017 07:25:51 GMT+11:00, Bruce Tate  wrote:
>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, 2017 at 2:17 PM, Tallak Tveide 
>wrote:
>
>> 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 received this message because you are subscribed to the Google
>Groups
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it,
>send an
>> email to elixir-lang-core+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/elixir-lang-core/8a1f314b-efdb-468d-8dae-
>> ba6492aa0f95%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
>-- 
>Bruce Tate
>President, RapidRed, LLC
>Phone: 512.772.4312
>Fax: 512 857-0415
>
>Author of Seven Languages in Seven Weeks, Deploying Rails Applications,
>From Java to Ruby, Rails: Up and Running, Beyond Java, 6 others.
>
>-- 
>You received this message because you are subscribed to the Google
>Groups "elixir-lang-core" group.
>To unsubscribe from this group and stop receiving emails from it, send
>an email to elixir-lang-core+unsubscr...@googlegroups.com.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/elixir-lang-core/CAMp4_igDYoGoJFcM6B55cfjttcvZKaJ%3Dag8ksQQN-LtNGD2Nag%40mail.gmail.com.
>For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/2649817D-21D7-4C50-B477-7038486C9849%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


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://thisagilelife.com #podcast

===
I welcome VSRE emails. Learn more at http://vsre.info/
===


On Tue, Feb 14, 2017 at 7:41 PM, Ben Wilson  wrote:

> This has my vote as well. It would make visually inspecting maps a lot
> easier.
>
> On Tuesday, February 14, 2017 at 7:36:05 PM UTC-5, Onorio Catenacci wrote:
>>
>> +1 Eric
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/elixir-lang-core/934ffbee-44a6-40fb-9ecf-
> e24d48624f3f%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAJr6D4S81ZqQ%2BaZQrw_rohpPXxwBpUWz1WsAEUZ82fjT02U7Pg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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://thisagilelife.com #podcast
>
> ===
> I welcome VSRE emails. Learn more at http://vsre.info/
> ===
>
>
> On Tue, Feb 14, 2017 at 7:41 PM, Ben Wilson 
> wrote:
>
> This has my vote as well. It would make visually inspecting maps a lot
> easier.
>
> On Tuesday, February 14, 2017 at 7:36:05 PM UTC-5, Onorio Catenacci wrote:
>
> +1 Eric
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/934ffbee-44a6-40fb-9ecf-e24d48624f3f%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/CAJr6D4S81ZqQ%2BaZQrw_rohpPXxwBpUWz1WsAEUZ82fjT02U7Pg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CABu8xFDzE7u%2BbSHgR4Z5xxLHtFox44LQq3y2ZaDsamZjdLzSTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.