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.
查看博客文章,了解更多详细信息以及对当时实际代码的引用.