好!好!好!顶楼主。
#4 楼 @reyesyang 做测试嘛。大家都说 ruby 可以写,你不试一下怎么知道他不好用呢。
#5 楼 @willmouse 挺有意思的。
什么意思?
works better, works faster.
#6 楼 @jimrokliu 他们没有检查出来劣质零件?
#1 楼 @luikore 做了一个简易版本,https://github.com/hlxwell/em_apn_manager
证书上传是挺危险的,但是我看了 urbanairship 他们就这么做的。
#24 楼 @leomayleomay 挺好的。如果 rails 默认就支持那就好了。不用利用第三方的东西去解决
#3 楼 @blacktulip 能 Cache 跟性能慢 是 2 嘛事。
性能不好。老要做 cache,然后就得话很多时间去管理 cache 了。
[13] pry(main)> Benchmark.measure { List.includes("words").find("510c032836bf8ac768014d84") }
=> #<Benchmark::Tms:0x007ff8f2a08988
@cstime=0.0,
@cutime=0.0,
@label="",
@real=2.316829,
@stime=0.05999999999999983,
@total=2.3000000000000016,
@utime=2.240000000000002>
[14] pry(main)> Benchmark.measure { List.find("510c032836bf8ac768014d84") }
=> #<Benchmark::Tms:0x007ff8f169e758
@cstime=0.0,
@cutime=0.0,
@label="",
@real=0.001487,
@stime=0.0,
@total=0.0,
@utime=0.0>
MONGODB (0.8ms) memoryforcer_development['lists'].find({:_id=>BSON::ObjectId('510c032836bf8ac768014d84')}).limit(-1).sort([[:_id, :asc]])
MONGODB (0.8ms) memoryforcer_development['lists'].find({:_id=>BSON::ObjectId('510c032836bf8ac768014d84')}).limit(-1).sort([[:_id, :asc]])
MONGODB (28.8ms) memoryforcer_development['words'].find({"list_id"=>{"$in"=>[BSON::ObjectId('510c032836bf8ac768014d84')]}})
0.8ms VS 28.8ms
Mongo 里的 .in Array 效率超级低。
#18 楼 @blacktulip 代码已分享,查看更新部分。
你真蛋疼