[erlang-questions] list comprehensions speed

Snyder, Hal Hal.Snyder@REDACTED
Tue Feb 25 15:26:31 CET 2014


4. And tell us what you find out. :-)


On 2/25/14 8:24 AM, "Motiejus Jakštys" <desired.mta@REDACTED> wrote:

>2014.02.25 14:08, Oleg raš?:
>>   Hello.
>> 
>> I'm erlang newbie. Don't beat me, please :-), if this question is
>>obvious.
>
>Hi,
>
>these questions are best to just test. It's simple:
>
>> timer:tc(fun million_list_comprehensions/0).
>> timer:tc(fun million_get_values/0).
>
>You will get a 2-tuple. First element in that tuple will give function
>execution time in microseconds.
>
>Things to have in mind:
>1. Put it to module and compile it, do not run from the shell.
>2. Make sure to make a loop so it runs more than 10ms (so it actually
>shows something).
>3. Run more than one test for each clause.
>
>Have fun!
>
>Motiejus
>_______________________________________________
>erlang-questions mailing list
>erlang-questions@REDACTED
>http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list