简体   繁体   English

平演员树

[英]Flat actor tree

Can there be such a thing as too many child actors? 可以有太多的儿童演员吗? For example, if I had an actor with 10000 child actors, would that affect overall performance compared to 10 actors with 1000 child actors each? 例如,如果我有一个拥有10000名儿童演员的演员,那么与每个拥有1000名儿童演员的10名演员相比,这会影响整体表现吗?

-= Why I'm asking =- - =为什么我要问= -
I have a problem where an actor has to be spawned at one point of time and tried to be accessed to later. 我有一个问题,一个演员必须在一个时间点产生并试图稍后访问。 There might be thousands of such actors waiting. 可能有成千上万的这样的演员在等待。 Once later accessed, an actor should perform a computationally heavy task and then die. 一旦稍后访问,演员应执行计算繁重的任务然后死亡。 These actors don't need to talk to parent at any point of their life (except that parent should react appropriately to childs' possible failures). 这些演员在生活的任何阶段都不需要与父母交谈(除了父母应该对孩子的可能失败作出适当的反应)。

I don't have experience in working with actors and it just seems very easy to have them all with one parent so I can access any child by substituting it's name in path without making (actor_id => path) lookup maps or anything. 我没有与演员合作的经验,看起来很容易将它们全部放在一个父母身上,所以我可以通过在路径中替换它的名字来访问任何孩子,而无需制作(actor_id => path)查找地图或任何东西。 I'm concerned whether this design decision alone can slow down single parent actor or make it more fragile somehow? 我担心这个单独的设计决定是否会减慢单亲演员的速度或使其更加脆弱?

The question is "Performance of what"? 问题是“表现什么”?

Let's transpose the question onto real life: 让我们将问题转化为现实生活:

Can there be such a thing as too many children? 可能会有太多孩子这样的事情吗? For example, if I had a friend with 10000 children, would that affect overall performance compared to 10 friends with 1000 children each? 例如,如果我有一个有10000个孩子的朋友,那么与10个拥有1000个孩子的朋友相比,这会影响整体表现吗?

"Clearly" the tradeoff is that the more children you have, the less time you have for each of them, and, if you die, more of them will be orphaned. “显然”权衡的是,你拥有的孩子越多,你们每个孩子的时间就越少,如果你们死了,他们中的更多就会成为孤儿。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM