为什么“避免使用你所需要的枚举”从Android的性能提示中删除? [英] Why was "Avoid Enums Where You Only Need Ints" removed from Android's performance tips?

查看:75
本文介绍了为什么“避免使用你所需要的枚举”从Android的性能提示中删除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

避免枚举你所需要的地方部分已从官方的开发人员文档。 (请参阅为什么Android不会使用更多的枚举?旧的部分内容)

The section "Avoid Enums Where You Only Need Ints" was removed from the official developer documentation. (See Why doesn't Android use more enums? for the old section content)

为什么?是否有更改Android VM,使提示过时?

Why? Was there a change in the Android VM that made the tip obsolete?

推荐答案

从Elliot Hugues的2011年答案说,原来的原因为了避免枚举是出于性能原因...在处理性能中。由于这个原因没有得到实际的支持,所以它从官方文档中被删除。

The 2011 answer from Elliot Hugues said that the original reason to avoid enum was for performance reason... as in "processing performance". As this reason was not backed by fact, it was removed from the official documentation.

稍后添加,因为枚举在内存中添加了比使用整数更多的数据。

It has been added later on because enums add a lot more data in memory than using integer.

这篇关于为什么“避免使用你所需要的枚举”从Android的性能提示中删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆