JavaScript Performance Debunked !

JavaScript is all about performance !

So why is it a commonly held belief that it is faster is JavaScript to fetch an inline constant than to fetch a value from a variable ?

The actual fact is the runtime performance is negligible even when the value is stored in some kind of wierd array inside an object.

The other odd and interesting point is that this coding effort grew out of the need to validate a gut feeling of mine that said there would be no runtime performance gain from placing constant values inline rather than fetching them from some kind of object some may wish to call a “closure“.

Here’s the code and the results of my tests using FireFox 3.6.10 – similar results from Chrome but alas IE will not perform as well so if your target is IE then you will have to modify the code that runs the test even though the results will be about the same for IE – still no benefit from placing constants inline rather than fetching them from a variable.

JavaScript Performance Tests

Advertisements

Agile Android Development is all about the Tools !

Android Development can be very time-consuming !

Agile Android Development is all about the Tools !

Get the right tools and you can whip-up Android Apps quickly and easily.  Use just the Google SDK and you will be slogging it out up to 5x longer just like everybody else.

Where are the Agile Android Development Tools ?

Adobe Flex is very Agile but only for those who are not stuck in the Cairngorm nightmare. Sadly all to many would-be Agile developers are stuck having to slog it out with Cairngorm and all because they cannot teach their developer slaves where to put things unless they have Cairngorm to tell them – this is very sad because effective Flex development is not rocket-science.

ELIPS from Open Plug is a nice Development Suite for Android developers who prefer to get their Android Apps up and running quickly and without having to know about the Android SDK.

Why do we use high-level languages anyway ?

Developers use high-level languages like C/C++ so they don’t have to code using that cool Assembler they could use to produce hand-optimized Assembly code that would just run faster than if they used C/C++.

Developers use Python so they don’t have to code C/C++ and there are Python tools that allow developers to code C extensions without having to slog through C code.

Developers use Flex and AS3 to get away from slower running JavaScript and HTML/DHTML and to make their web apps less vulnerable to hackers who can more easily modify JavaScript and HTML/DHTML/CSS.

Developers use MXML to get away from having to slog it out with all that AS3 code – well those developers who know how to decrease their development time will do this – the rest will just take the longer route so they can make more money.

Android Developers use ELIPS to get away from having to slog through the Android SDK and all that Java code.

Hopefully the Open Plug people will keep developing their tools to allow the rest of use to benefit from their work.

I like the idea of focusing on the App rather than the SDK !

I really do not want to have to learn the Android SDK just to get some Android Apps into the market.

I want to focus on the solution rather than the SDK.

But then, I want to be Agile !

Agile Development is all about… Saving Time and Money !

What is Agile Development All About anyway ?!?

If your Agile Practice is not lowering the cost of development for your company or enterprise going forward then you quite simply do not know what Agile Development is all about and you are just wasting your time !

Agile Development is ALL about Lowering the Cost of Development

  • Reusable code.
  • Quick Development Cycles.
  • The Agile Method.

Reusable Code

I know for a fact that most companies are not working to reuse their code and this is nothing less than ridiculous.

Quick Development Cycles

Development Tools that remove the burden of having to memorize the underlying SDKs is a must !

Any developers who are spending their time memorizing SDK entry points are just wasting your money, Mr. Manager !    Why anybody who interviews potential employees or contractors requires their candidates to know the underlying SDKs well enough to recite from the book from memory is nothing short of most entertaining because this proves the interviewers know nothing about how to achieve truly Agile Development.

Development Tools that know the SDK API calls !

Why should I as an Agile Developer have to know the underlying SDK API calls ?   The Editor I use should know this with oodles of online help so all I have to do is go searching for specific functions or groups of functions – let the editor give me the syntax along with oodles of auto-completion support.  I should not need to know anything more than how to search for what I need but I should not need to know the underlying SDK API calls well enough to talk about them because doing that requires me to be less than Agile.

Development Tools that know the language syntax !

Sure, I need to know the syntax to write code but I should not need to know every single detail about the language syntax to get code written.

For instance, I have to know just 4 things about Python to be able to write effective Python code quickly.  First I need to know that I should put a “:” char at the end of my if and loop statements.  Second I need to know how to code a list comprehension statement.  Thirdly, I need to know that tab levels mean something to Python.  Finally I need to know how to code a function.  I do NOT need to know nor care about how to indent my code other than tabs mean something or that I should be using a tab char to do so.  The IDE I choose to use handles the tabbing thing for me so I do not need to bother with having to hit the tab key when writing code.

As far as syntax is concerned, the compiler knows the syntax and it knows how to tell me when it is not happy with the code I have written.  All I need is a high-level understanding of what the syntax looks like and the rest is up to the compiler and my requirement to clear all the warnings and errors.

I hear people crying about Python from time to time however during the past 5 years having coded millions of lines of Python code myself I can say I have never had any problems with Python that could not be ironed-out with my favorite IDE which just happens to be the Wing IDE.

The same people who cry about one language or another are the same ones who cry about the weather whenever it rains or snows.  I prefer to understand what to do with it rains, like carrying an umbrella however I live on the west coast where it don’t snow much so I need not worry about having to shovel that white stuff.  Likewise, I use development tools that handle the mundane tasks for me so I do not need to and so I never have to complain about such things.

Use Programming Languages that perform best !

Runtime performance is the goal !

Programming ease is secondary.

Those who place programming ease ahead of performance are morons !  (Take that all you Ruby on Rails people !  You know who you are…)

I get the same programming ease from Python but I also get much better performance with Python than Ruby on Rails.  I have to work less to achieve reasonable performance when using Python than were I to try to achieve the same level of development when using Ruby on Rails.

Whenever I need to get down and dirty and boost the performance of my Python code, and this does not happen often, I can always whip-up some C++ Extensions without ever having to touch a line of C++ since I can do so while using nothing but Python code through the use of Cython.

First and foremost there is Psycho for Python; 32-bit only but it boosts performance by 2x to 100x with the average being around 4x faster !

Use a Dynamic Programming Language !

Ruby is Dynamic but it suffers from crappy performance.

Java is popular but Java is a Static Language !

Python is more widely used by those who want to balance performance with programming ease also known as “fun”.

There is no other IDE for Python than Wing IDE because the Wing IDE is the only one, I can find, that provides that slick Debug Probe thing that allows me to try some code at any stack level I want without having to rerun my code.  Trust me, this saves a ton of time and this gets my code up and running much faster than might otherwise be possible and trust me, I use Eclipse when coding Java or Flex and I hate the fact that I have to recompile my code when using Eclipse before I can try-out some alternatives upon hitting a break-point.

Conclusion

So you think YOU are Agile ?!?   Think again and then work on lowering the cost of development because that is the true measure of being “Agile“.

The Complete Lack of Agility in Corporate America !

Why is it so many I.T. Managers simply do NOT understand what being Agile Means ?!?

Whenever I talk with I.T. Managers, and I talk to them quite often, I am constantly faced with a complete lack of understanding as to what being Agile really means.

Point #1

You cannot be Agile is you have to make a conscious effort to remind yourself of all those little silly programmer details !

For instance, who cares what a default routes.rb file does in good ole Ruby on Rails !

You cannot seriously think the default routes.rb file has any bearing on doing professional work, can you ?!?

Of maybe you can, but there is very little real value in using the default routes.rb file.  There is very little value in using the exact same patterns everyone else is aware of because doing so leaves your online systems vulnerable to hackers who know the standard patterns everyone is supposed to know about.

Point #2

At some point all human being simply must move along from having to recite simpler facts to working with more complex facts.

All of us who went to grade school in the U.S. had to recite our A,B,C’s whenever we were asked to do so as a way to demonstrate this basic level of understanding however a time did arrive, and thankfully so, when we were simply assumed to know that the English alphabet was all about and we were not asked about the A,B,C’s beyond that point in time.  Generally speaking, the point one graduated from one grade to another is when teachers ceased asking us to recite the overly simplistic so they could appear to be intelligent.

It completely blows me away that anyone in a professional setting would waste their time and the time of anyone they interview with overly simplistic questions about details only a noob would care about.  Sure I can sit there and recite the Alphabet just to prove I know there is such a thing as the English Alphabet but then I could also recite the multiplication tables as well as some early U.S. History.  Asking a professional who has more than 5+ yrs of software engineering experience about overly simplistic details no professional would seriously care about let alone ever deal with is senseless and stupid.  ( I was about to say it was border-line stupid but then I realized it is nothing less than stupid.)

I get most I.T. Managers have no real software engineering experience.  I also get most I.T. Managers cannot expect to know what what real-world software development is all about.  What I do not get is why a fellow geek would bother asking about silly stupid details like the interaction I am about to share with you.

Point #3

I want to feel as-though the people I am talking with are at-least somewhat intelligent.

When I am talking with people I can only feel I am talking with someone who has some intelligence if certain assumptions exist between us.

If I am asked about topics I learned back when I was in grade school I tend to feel the person who asked me about that stuff is a moron !  And rightfully so !

If I am asked about topics I feel are more on a level of those who have the experience we are telling each other we have I may feel the person I am talking with has some intelligence and the person I am talking to might feel the same about me.

When an I.T. Manager chooses to ignore what I have stated in my Resume I feel as though that person chose to either not read what was written or read it and then chose to disbelieve it for whatever reason.

When a person I may be working for chooses to ask questions about certain facts I would not be able to get away with on the job I feel I am talking with a complete moron, and rightfully so !

Point #4

It is NOT possible to make an assessment as to the skill someone has by talking about those skills.

This is a fact that can be proven and is proven on a daily basis in Corporate America.

The only thing one can learn by talking with someone is whether or not that person can communicate verbally.

Were it possible to make an assessment as to the skill someone has by talking to them there would be no need for professional sports teams to hold try-outs – they would simply talk to each athlete to make their assessments.  And yet, athletes are asked to perform on the field using actual equipment they might be asked to use were they to make the team.

Some few companies have tried to form their assessments about technical skills by asking the person being interviewed to perform however unless I am used to using a specific computer with a specific keyboard and mouse along with specific software I will invariably stumble about for a short time until I can build-up enough muscle memory to make equipment I do not use daily useful to me.  I am sure most humans have this same experience and so it is again NOT possible to make an accurate assessment under the conditions most companies have chosen to use.

Most companies choose to employ some kind of written test to make their skills assessments.  The problem with this is they also choose to bar those who take those tests from using Google, for instance.  Now I don’t know what everybody’s experience is while they are on the job but I do know what my experience has been across the board and I have absolutely NEVER been asked to seriously not use Google when working in a professional capacity in Corporate America.  Even a company like Verizon Wireless, who when I was there from 08-2009 through 04-2010 would not allow their employees to use GMail because I was told GMail is not a secure site and could cause problems of some kind – then later this policy was reversed and GMail was allowed.  Let’s ignore the fact that Verizon Wireless was at that time trying to form an alliance with Google over the Android OS and the fact that Verizon Wireless’s internal policies stated they felt certain Google Sites could not be trusted – Verizon Wireless also made no attempt to form a policy that stated Google was off-limits.  Why ?   Because access to the Internet and the use of Google is seen as being a requirement when working on a professional level because doing so saves time.

What freaking moron would want to tell a professional to not use Google when taking a test that is supposed to highlight technical skills ?  What moron indeed ?!?

It is NOT possible to make an assessment as to the technical skill someone has by writing about those skills.

If you want to make an assessment as to technical skills then watch what people do on the job for a period of time.

Professional Skills require a professional and professionals get paid for their work or they are NOT being professionals.

Point #5

Nobody in Corporate America can or will hire above their own skill-level !

Nobody wants to let anyone see they themselves are lacking in some technical area therefore the safest bet is to hire at or below one’s own perceived skill-level, to do otherwise would be professional suicide, or so the feeling must go according to how professionals are being interviewed per my own observations.

This must be why people choose to ask the dumbest most asinine questions known to mankind during their interviews.  They want to know the person they are about to hire has the least technical skill as compared to their own.  If more advanced questions were to be asked and the person they asked responded in an intelligent manner the person asking those questions might appear to have more skill than the person who is asking the questions and if Management were to learn about this who might get the better job ?!?   Hmmmm ?!?

California is an at-will state !

Employment at-will allows companies to make a hiring or firing decision without any regard to the consequences or their actions.  Why is it any company would wring their hands over who to hire is a complete mystery to me.  The only person who carries the risks of not being able to perform on the job is the prospective employee.  Companies carry no risks in this regard.

What is the point of asking anyone in California to pass any kind of technical skills assessment is wasteful and stupid, IMHO.

Given the fact that technical skills cannot be assessed using any process other than to watch what people do on the job and the fact that California is an at-will state means the only sure and most economical way to make a real-world technical assessment is to hire people and watch what they do on the job.

Why not hire 10 people, let all 10 know there is one slot open and that a decision will be made at the 6 month mark and then watch to see which of the 10 does a better job ?!?  Worried about spending too much money in this regard ?  Make the period 3 months and offer less money during this 3 months than would be awarded upon hire ?!?

At a point when there are 2 million unemployed people in California it seems stupid to me to put prospective employees through a verbal or written form of technical skill assessment as a way to vet a prospective employee.

Those who have great verbal skills and great rote memories will pass the initial technical screens with flying colors – even those who cannot substantiate their skills using the rest of their minds and bodies.

Those who have great technical skills but no desire to talk about what they know will be shunned by the very companies who should be hiring this kind of a person.  Technical skills have nothing to do with speaking or writing.  Technical skills have everything to do with doing the work using one’s hands.

Software Engineering has more to do with one’s fingers tickling a keyboard while working on a software problem than whether or not one can verbalize what is being done.

Software Engineering has more to do with one’s fingers tickling those keyboards one is tickling most often while working on a software problem than whether or not one can verbalize or write about what is being done.

Those who can write code faster than they can talk about the code they may wish to write will have verbal skills that suck even though they will be able to write stellar code with the best of them.

And don’t even get me started about those who have to use a white-board when writing their code.  Nobody ever produced working code when using a white-board and yet more times than I care to recount I am asked to write some code on a white-board – idiots ! White-boards are for scribbling upon, not useful when writing software.

I spent just about 10 minutes more than 36 years ago figuring-out how useless a white-board is when writing code.  I spent more time scribbling on the white-board that could have been used to write the code.  I get far more code written while sitting-down with hands on my keyboard than were any other technique to be used to achieve the act of writing code.

Point #6

Nobody is being asked to be innovative in Corporate America !

Innovation is virtually dead in Corporate America by and large.  Sure there are small pockets of innovation but even those are few and far between.

Innovation is shunned in Corporate America.

I have been point-blank told by the Manager conducting more than one interview with me that I would not be allowed to be the least bit innovative on the job.  Insight, innovation and intuition are not desire attributes in Corporate America !

Leadership is not a skill that is being taught in Corporate America.

Innovation is not desired.

Point #7

Can America maintain her leadership in the world ?   No, but then who really cares about this anyway ?!?

%d bloggers like this: