erlang 进程消息及ets性能测试

进程消息发送与接收

1> test:test_proc_msg(10000000, {"test"}).
{3145000,ok}
2> test:test_proc_msg(10000000, {"test","test"}).
{3731000,ok}

3> test:test_proc_msg(10000000, {"testtesttesttest"}).
{4428000,ok}
4> test:test_proc_msg(10000000, {"testtest"}).
{3607000,ok}
5> test:test_proc_msg(10000000, {"test"}).
{3237000,ok}

1000W条简单消息发送接收时间3~4秒,每秒可以处理200W的消息,消息的大小对速度影响比较大


ets查询性能

3> test:test_ets(10000000, "test").
{ {insert,{17341000,ok}},{lookup,{1717000,ok}}}

1000W万次ets写入花了17.3S,平均57W/S

1000W万次ets查询花了1.7S,平均580W/S,约为写入时间的十分之一


-module(test).


-compile(export_all).


-define(TAB, tab_name).
%%测试ets查询性能
test_ets(Num, Msg) ->
    ets:
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值