Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #26933

Re: Java 8 closures vs. anonymous inner classes

From Arved Sandstrom <asandstrom2@eastlink.ca>
Newsgroups comp.lang.java.programmer
Subject Re: Java 8 closures vs. anonymous inner classes
References <l7nuiv$ajm$1@news.albasani.net> <5yTqu.2639$oo4.861@fx02.iad> <P9SdncjbN7I81zHPnZ2dnUVZ7v6dnZ2d@bt.com> <52acd57f$0$302$14726298@news.sunsite.dk>
Message-ID <xBmru.339509$bQ1.275512@fx10.iad> (permalink)
Organization Public Usenet Newsgroup Access
Date 2013-12-15 14:33 -0400

Show all headers | View raw


On 12/14/2013 06:02 PM, Arne Vajhøj wrote:
> On 12/14/2013 7:03 AM, Chris Uppal wrote:
>> Arved Sandstrom wrote:
>>
>>> To put it bluntly, who cares? The last time I ran into a speed
>>> bottleneck with any language was over a decade ago.
>>
>> Hmm...
>>
>> Maybe you mean something more specific than I'm understanding, but
>> that isn't
>> my experience at all.  I'd say about 1/3 of my working time is spent on
>> performance-motivated stuff: re-writing things to be faster (or not as
>> slow),
>> experimenting to see if thngs /can/ run at reasonable speeds, finding
>> workarounds (or at least excuses) when they can't...
>>
>> And I work with desktop to server-class machines.
>>
>> But those are mostly architectural issues -- maybe you mean something
>> more like
>> "performance problems caused by a uniformed/ill-advised use of the
>> idioms of
>> the language" ?
>
> I think Arved's statement was in the context of two different language
> constructs with similar functionality resulting in different byte code.
>
> Performance problems are common.
>
> But byte code optimization "assembler programming in Java" is
> rarely the cause of those performance problems.
>
> Arne
>
>
I mostly meant what Chris surmised I meant. In other words, avoiding the 
need for optimization by writing stuff correctly in the first place. 
Basic programmer skills...choosing the correct data structures, choosing 
algorithms well, managing resources properly, etc.

To use a specific example, let's say you have to write a JSF web app 
that uses Tomcat and also JPA. Reading information like 
http://www.mulesoft.com/tomcat-performance (or any of the dozens like 
it) is something you should do ahead of time, not after. Understanding 
the JSF lifecycle, and hence knowing what managed bean methods get 
accessed how often - and by extension, when and how often business logic 
and data layer methods get accessed, is available upfront knowledge: no 
programmer should need a postmortem profiler run to tell them that 
time-consuming logic in a JSF managed bean getter is maybe a bad idea. 
It's a web app: understanding concurrency, and how to be threadsafe 
without major performance hits, is also something to be understood ahead 
of time, not after you deploy the app. And a JPA implementation can be a 
performance pig or no serious problem at all...assuming you read some 
docs and exercised some common sense ahead of time.

I did mean what I said about not having encountered speed bottlenecks 
with a *language* - any programming language - in at least a decade. In 
my experience it's almost always been improper use of a language or 
libraries, or insufficient resources, or network latencies, and so forth 
- not a core deficiency of a language. The last time I used C or C++ to 
speed up a language was I think with PerlXS or SWIG back in the '90s.

Don't get me wrong: I've often been engaged with trying to speed up a 
program, and using profilers. And invariably it turns out to be bad 
architecture or design, or bad implementation, or resource or network 
constraints...so not a language problem.

To Arne's point, I do believe that too, and that's partially what I 
meant. I sincerely believe that your typical Java programmer - myself 
included - really doesn't have to worry about the bytecode result of 
their proper use of source.

AHS
-- 
When a true genius appears, you can know him by this sign:
that all the dunces are in a confederacy against him.
-- Jonathan Swift

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Java 8 closures vs. anonymous inner classes Sebastian <news@seyweiler.dyndns.org> - 2013-12-04 20:07 +0100
  Re: Java 8 closures vs. anonymous inner classes Sven Köhler <remove-sven.koehler@gmail.com> - 2013-12-04 22:27 +0200
    Re: Java 8 closures vs. anonymous inner classes Patrick Roemer <sangamon@netcologne.de> - 2013-12-05 00:38 +0100
    Re: Java 8 closures vs. anonymous inner classes v_borchert@despammed.com (Volker Borchert) - 2013-12-04 23:45 +0000
  Re: Java 8 closures vs. anonymous inner classes Roedy Green <see_website@mindprod.com.invalid> - 2013-12-06 13:28 -0800
    Re: Java 8 closures vs. anonymous inner classes Arne Vajhøj <arne@vajhoej.dk> - 2013-12-14 16:46 -0500
  Re: Java 8 closures vs. anonymous inner classes Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-12-14 03:13 -0400
    Re: Java 8 closures vs. anonymous inner classes "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-12-14 12:03 +0000
      Re: Java 8 closures vs. anonymous inner classes Arne Vajhøj <arne@vajhoej.dk> - 2013-12-14 17:02 -0500
        Re: Java 8 closures vs. anonymous inner classes Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-12-15 14:33 -0400
    Re: Java 8 closures vs. anonymous inner classes Arne Vajhøj <arne@vajhoej.dk> - 2013-12-14 17:00 -0500
      Re: Java 8 closures vs. anonymous inner classes Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-12-15 15:05 -0400
        Re: Java 8 closures vs. anonymous inner classes Wanja Gayk <brixomatic@yahoo.com> - 2013-12-17 20:09 +0100
          Re: Java 8 closures vs. anonymous inner classes Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-12-20 22:28 -0400
            Re: Java 8 closures vs. anonymous inner classes lipska the kat <"lipskathekat at yahoo dot co dot uk"> - 2013-12-21 11:54 +0000
              Re: Java 8 closures vs. anonymous inner classes Joerg Meier <joergmmeier@arcor.de> - 2013-12-21 18:27 +0100
                Re: Java 8 closures vs. anonymous inner classes lipska the kat <"lipskathekat at yahoo dot co dot uk"> - 2013-12-21 18:23 +0000
                Re: Java 8 closures vs. anonymous inner classes Tim Slattery <tim@risingdove.com> - 2013-12-21 14:56 -0500
                Re: Java 8 closures vs. anonymous inner classes lipska the kat <"lipskathekat at yahoo dot co dot uk"> - 2013-12-21 20:10 +0000
                Re: Java 8 closures vs. anonymous inner classes lipska the kat <"lipskathekat at yahoo dot co dot uk"> - 2013-12-21 21:18 +0000
              Re: Java 8 closures vs. anonymous inner classes Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-12-21 14:52 -0400
                Re: Java 8 closures vs. anonymous inner classes lipska the kat <"lipskathekat at yahoo dot co dot uk"> - 2013-12-21 19:35 +0000
                Re: Java 8 closures vs. anonymous inner classes Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-12-21 19:34 -0400
                Re: Java 8 closures vs. anonymous inner classes leif.roar@invalid.com (Leif Roar Moldskred) - 2013-12-22 05:02 -0600
                Re: Java 8 closures vs. anonymous inner classes lipska the kat <"lipskathekat at yahoo dot co dot uk"> - 2013-12-22 11:12 +0000
                Re: Java 8 closures vs. anonymous inner classes Wanja Gayk <brixomatic@yahoo.com> - 2013-12-22 21:24 +0100

csiph-web