基于Scala的函数式编程高性能Actor开源框架AsyncFP发布后,在Scala领域引起了一场争论,争论关键还是如何更好地利用底层硬件或操作系统机制,以及如何更好地切合JVM。
争论文章地址:Why AsyncFP? Does Scala really need another type of actor? 我们是否真的还需要另外一种Actor呢?
在Why AsyncFP这个PDF中,作者谈到:
● Computers are getting fatter, not faster. An i9 chip has
12 hardware threads. A Spark T4 has 64 hardware
threads.
计算机越来越胖,而不是越来越快。i9有12个硬件线程,而Spark T4有64个硬件线程。
● Code that can use all that hardware is very difficult to
write. Often it is better to use that extra hardware for
something like EJB when its performance is good
enough
试图使用所有的硬件线程的编程代码是难以编写的,较好的办法使用额外硬件(水平扩展Scalable)。(banq注:这也是为什么我经常提出进行一些宏观解决方案的原因。)
● Even when multi-threaded code is correct, it often runs
slower than single-threaded code.
即使多线程代码编写正确了,它也经常会比单线程代码运行慢(banq注:共享锁可能带来的)
● Single-threaded servers written using Node.js are
popular because they are fast and easy to write. But
then what do we do with really fat computers?
这也就是为什么使用Node.js编写的单线程服务器受到如此欢迎的原因,因为他们快而且易于编写,但是我们为什么又需要这些有很多线程的胖计算机呢?
待续...