Degrafa 状态内存管理
我最近正在分析我的应用程序,该应用程序在皮肤中使用 Degrafa States,并注意到这样做使用的内存比我预期的要多。在 SetProperty 和 State 之间,它们使用了大约 10% 的总已用应用程序内存。
使用 css 来更改状态并为每个状态使用新皮肤会更好吗?
或者
有一些简单的技巧可以减少 degrafa 的内存占用吗?
I was recently profiling my application that uses Degrafa States in the skins and noticed that doing so uses more memory than I expected. Between the SetProperty and State, they were using about 10% of the total used application memory.
Would it be better to use css for the state changes and a new skin for each state?
or
Are there some simple tips to reducing the memory footprint of degrafa?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Degrafa 皮肤中的状态与 UIComponent 中的状态并不完全相同。对于初学者来说,它们是通过“name”属性而不是“currentState”选择的。除此之外,这是你无法控制的,你正在皮肤的 UIComponent 将始终为每个状态创建一个新的皮肤实例,除非你设置了 xxxSkin:ClassReference(null);在你的 CSS 中。 Degrafa States 只是允许您编写一个更具可读性和可维护性的皮肤类,可以为皮肤 UIComponent 的每个“状态”进行实例化。
States in Degrafa skins aren't exactly like they are for UIComponents. For starters they're selected by the "name" property, rather than "currentState". Besides that, it's out of your control, the UIComponent that you're skinning will always create a new skin instance for each state, unless you've set xxxSkin:ClassReference(null); in your CSS. Degrafa States just allow you to write a more readable and maintainable skin class that can be instantiated for each "state" of the skinned UIComponent.