On Thu, Nov 24, 2011 at 8:44 PM, Lew <lewbl...@gmail.com> wrote:

> Bret Foreman wrote:
>>
>> If the OP is really concerned about performance he can create an array
>> of objects and implement his own protocol for reusing them. Then after
>> the initial creation of the array, no objects need to be either
>> created or destroyed.
>>
>
> This might or might not have any effect on performance, much less a
> noticeable one.
>
> The OP has shared no evidence that they have a performance problem,
> related to GC or otherwise.
>
> There is no evidence that your approach would help, because changing the
> lifetime of objects influences GC in sometimes unexpected ways.  Even if
> the array approach did shave of a few milliseconds here or there, the added
> complexity of manually taking over memory management could create slowdowns
> and likely would create errors, and the effect on overall application
> performance would still be negligible.
>
> If the OP is really concerned about performance, and willing to behave
> like an intelligent person, he can *measure* the app's performance under
> realistic conditions, *profile* it and determine where the inefficient
> spots are *before* and *instead of* engaging cargo-cult superstitions about
> what will help.
>
>
Maybe I didn't explain myself very clear, sorry for this and for my
english, as this is not my first language. So, I'll try to clarify myself,
as I am being addressed as stupid (not like that, but saying things like
"willing to behave like an intelligent person" implies that I'm not
behaving like one):
I have not started the developed of that part of the application, so I
can't measure or profile the performance. I was first doing a bit of
research, to try to do things as they should be done, from the beginning,
not start doing thins randomly, and then try to improve the results. So I
came here to ask for possible solutions I might not know (as I know I'm not
an expert, not in Java and not in Android). My first idea was to do it as
all of you suggested, by using objets (classes for structs). But I read on
android webpage (see the link I shared before) that we should avoid
creating objets when possible.
So, as I don't know any other means of doing this without creating objects,
I came here, to ask if there was another way of doing this in android, that
I'm not aware of.

So, I'll start creating classes, as suggested, and If find some performance
problems, I'll try the alternative ways suggested here.

Thanks to everyone for your help and time ^_^

Best regards!


> If you double the speed of something that only took 0.01% of overall
> execution time, but you have tripled the maintenance costs for the whole
> app and added new bugs that require new fixes, how is that a win?
>
> --
> Lew
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
---
http://aitorTheRed.blogspot.com
http://www.last.fm/user/aitorTheRed/

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to