开发者

android mobile development performance vs extensibility

im developing a game in android, and i've been thinking about subdividing many of the elements of the game (e.g. game objects) into separate classes and sub-classes. but i know that method calls to these objects will cause some overhead. would it be better to 开发者_JAVA百科improve performance or to improve extensibility?


Only you can answer that question - some games require the utmost in performance, others become so complex that ease of extensibility is the only way to go.

Bear in mind though that the 'overhead' you're referring to is likely to be VERY small - nearly infinitesimal - and should not be high on your list of concerns for any initial release.

Remember too that it's always easier to extract performance later, the same can not be said of extensibility.

Finally, note that premature performance tweaks frequently fail. Ascertaining where the performance bottlenecks are can seldom be predicted, testing in situ is far more like to yield good results.


Have you considered inline functions? That way you may preserve extensibility and clearness of code, ideally without a performance loss.


At first just build in the most elegant way.

At last optimize the bottlenecks leaving the rest intact.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜