gpt4 book ai didi

design-patterns - Brendan Eich 对属性模式的性能优化是什么?

转载 作者:行者123 更新时间:2023-12-04 18:09:28 31 4
gpt4 key购买 nike

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.



查看博客文章以获取更多详细信息以及对当时实际代码的引用。

关于design-patterns - Brendan Eich 对属性模式的性能优化是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18187972/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com