Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #34876
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Event overhead, does it matter? |
| Date | 2016-07-13 10:36 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <nm5jm0$5dk$1@dont-email.me> (permalink) |
| References | <9c586a05-dbbd-4ebc-b61c-a53269421858@googlegroups.com> |
On 7/13/2016 9:51 AM, Eric Douglas wrote:
> Is one method more efficient (speed, memory) or is it just a matter of personal preference?
>
> Method 1:
> [... one FocusListener shared by two components ...]
>
> Method 2:
> [... two FocusListeners, one for each component ...]
One method is (probably) more efficient. Performing measurements
to discover which is left as an exercise for the reader. (I suspect
that measuring the memory footprints might be comparatively simple,
while measuring the execution speeds might be next to impossible. I
also suspect that neither set of measurements would be worth while.)
As a matter of style, I'd vote for Method 2 on the grounds that
it's more easily modifiable if/when you decide to change the GUI.
--
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Event overhead, does it matter? Eric Douglas <e.d.programmer@gmail.com> - 2016-07-13 06:51 -0700 Re: Event overhead, does it matter? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-07-13 10:36 -0400 Re: Event overhead, does it matter? Arne Vajhøj <arne@vajhoej.dk> - 2016-07-13 10:45 -0400
csiph-web