How much time it will take if you add -MMoose I wonder? The thing is that in Erlang time and memory required to create a new process (it doesn't have threads) don't depend on what modules are loaded. At any time you can spawn several dozens of thousands of processes and it won't generally consume all available memory. Perl creates full copy of the interpreter for every thread, so you can't have too many of them, especially if you want to use something heavy in threads, like Moose. Don't pretend you don't know that.
Comparison doesn't really make sense and one-liners are not a strong side of Erlang, but here's an example from Erlang Programming that creates 10000 processes (in the book they actually starting at 100000):
-module(myring). -export([start/1, start_proc/2]). start(Num) -> start_proc(Num, self()). start_proc(0, Pid) -> Pid ! ok; start_proc(Num, Pid) -> NPid = spawn(?MODULE, start_proc, [Num-1, Pid]), NPid ! ok, receive ok -> ok end.
And running it from the erl:
3> timer:tc(myring,start,[10000]). {14283,ok}
Time is in microseconds.
In reply to Re^2: perl5 road map?
by zwon
in thread perl5 road map?
by xiaoyafeng
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |