Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Notice that lists comprehension at least twice as slow
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alex Zatvorskiy  
View profile  
 More options Jul 21 2012, 4:22 pm
From: Alex Zatvorskiy <a.zatvornits...@gmail.com>
Date: Sat, 21 Jul 2012 13:22:05 -0700 (PDT)
Local: Sat, Jul 21 2012 4:22 pm
Subject: Notice that lists comprehension at least twice as slow

Hey,

I have been doing some benchmarks. So, I have found that elixir's *lc* at
least as slow then erlang's original feature.
There are some benchmarks:

   - https://github.com/AZatvornitskiy/nodexs/blob/rc/test/erl.erl
   - https://github.com/AZatvornitskiy/nodexs/blob/rc/test/ex.ex

Just for notice ))

P.S: On the other hands, you should spread your purpose, and roadmap in
general.
Stay well ))


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
José Valim  
View profile  
 More options Jul 21 2012, 4:45 pm
From: José Valim <jose.va...@gmail.com>
Date: Sat, 21 Jul 2012 13:45:48 -0700 (PDT)
Local: Sat, Jul 21 2012 4:45 pm
Subject: Re: Notice that lists comprehension at least twice as slow

Hello Alex,

Thanks for the benchmarks.

The reason this happens is because our list comprehensions consider
everything in filters except false or nil to be true.
So this additional check costs us a bit. We could certainly optimize this
though, since operators (like < and >) and other BIFs are known to return
just booleans, allowing us to skip this check, I just haven't got to this
optimization stage (it surprises me that this check is causing all this
difference though).


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
José Valim  
View profile  
 More options Jul 22 2012, 4:33 am
From: José Valim <jose.va...@gmail.com>
Date: Sun, 22 Jul 2012 10:33:13 +0200
Local: Sun, Jul 22 2012 4:33 am
Subject: Re: Notice that lists comprehension at least twice as slow

Hello Alex,

I have pushed a commit to Elixir master that skips the conversion check if
the expression is known to return a boolean:

https://github.com/elixir-lang/elixir/commit/6a7602d974f13924a6db6a52...

This brings Elixir's performance to the same level as Erlang's for such
common comprehensions.

Cheers!

*
José Valim
www.plataformatec.com.br
Founder and Lead Developer
*


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Zatvorskiy  
View profile  
 More options Jul 28 2012, 9:52 am
From: Alex Zatvorskiy <a.zatvornits...@gmail.com>
Date: Sat, 28 Jul 2012 06:52:12 -0700 (PDT)
Local: Sat, Jul 28 2012 9:52 am
Subject: Re: Notice that lists comprehension at least twice as slow

Thanks a lot, I'll proceed


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »