当前位置 : 主页 > 网络安全 > 测试自动化 >

设计模式 – Brendan Eich对属性模式的性能优化是什么?

来源:互联网 收集:自由互联 发布时间:2021-06-22
他说,在 Steve Yegge’s essay on the prototype pattern年底, Brendan Eich came up with astoundingly clever performance optimization for the Properties Pattern, which he told me about back in January. I was ready to publish this article,
他说,在 Steve Yegge’s essay on the prototype pattern年底,

Brendan Eich came up with astoundingly clever performance optimization for the Properties Pattern, which he told me about back in January. I was ready to publish this article, but I told him I’d hold off until he blogged about his optimization. Every once in a while he’d ping me and tell me “any day now.”

Brendan, it’s October, dammit!

那张纸条差不多写在五年前了,但我似乎无法找到有关Eich优化的信息.他或其他人是否曾公布过Yegge提到的改进措施?

我去挖掘,从另一个答案中提到的 Brendan’s tweet开始,到 at this blog post from ’08结束.总结:

A lot of the benchmarks show that SpiderMonkey is significantly faster
than Tamarin. This has been mostly attributed to the way SpiderMonkey
accesses object properties. SpiderMonkey has an implementation of the
shape idea. A shape is a unique identifier which details the structure
of an object, and allows for a quick lookup of a given property. With
a few bit operations, given an object’s shape and the current program
location, we can find a property’s address.

查看博客文章,了解更多详细信息以及对当时实际代码的引用.

网友评论