Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设计模式——享元模式 #30

Open
hoperyy opened this issue Jun 25, 2017 · 0 comments
Open

设计模式——享元模式 #30

hoperyy opened this issue Jun 25, 2017 · 0 comments

Comments

@hoperyy
Copy link
Owner

hoperyy commented Jun 25, 2017

享元模式:flyweight

在 JavaScript 中,浏览器特别是移动端的浏览器分配的内存并不多,如何节省内存就成了一件非常有意义的事情。

享元模式是一种用于性能优化的模式。如果系统中因为创建了大量类似的对象而导致内存占用过高,享元模式就非常有用了。

  • 使用享元模式

    使用享元模式的关键是如何区别内部状态和外部状态。

    还没看完。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant