This is the only private message you will see in this blog.
Since all the thoughts i have about JavaScript and Front-end development totally occupied my mind i have to make this Blog to get them in order.
I am a web developer. My main area of interest for now is a JavaScript.
Yes i have read Douglas Crockford and yes i am subscribed for John Resig, Dion Almaer and other guys blogs.
I think JavaScript is a very powerful language and most widespread cross platform language in the world (since almost every OS have browser and almost every browser have JS implementation).
Also JavaScript is a great technology for web2.0 internet and all the buzzprojects we have now are impossible without it.
I am writhing a js framework named ARIESjs. I know there are a lot of frameworks around but i have my own vision and i want some things which the can not give. I will post the process of development and o lot of examples here, so stay tuned.
Javascript performance summary
I have an idea that Javascript could allow us to improve perfomance of our web applications. Of cause JS is very slow but unlike server side code we can run it on side of our clients. Something like client side cloud-computing.
It is jut an idea… for now.
Thing i can do right now is to improve performance of my scripts as much as possible. A lot can be gained just by following some coding style rules.
Javascript performance. Array vs Object
Reading and writing perfomance is not differs too much for this two. So you can easily use Object for mapping purposes and Array for unordered stuff.
details:
I have coded a simple profiler to test some siple pieces of code. Here it is:
function Profile(){ } Profile.prototype.status = 0;//0 free, 1 busy Profile.prototype.tests = []; Profile.prototype.testIt = function(){ if (!this.status && this.tests.length > 0) { var atest = this.tests.shift(); var that = this; var l = setTimeout(function(){ that.process(atest[0], atest[1], atest[2]); that.testIt(); }, 500); this.status = 1; } } Profile.prototype.profile = function(func, name, before){ Profile.prototype.tests.push([func, name, before]); this.testIt(); } Profile.prototype.process = function(func, name, before){ var AVGtime = 0; for (var i = 0; i < 20; i++) { var scope = {}; before.call(scope); var dbefore = new Date(); func.call(scope); var dafter = new Date(); AVGtime += dafter.getTime() - dbefore.getTime(); } this.report(func, AVGtime / 20, name); this.status = 0; } Profile.prototype.report = function(func, avg, name){ var funcDiv = document.createElement("div"); var report = "<div class='function' style='font-size: small; border: 1px solid #999; margin: 10px 0 3px 10px; padding: 5px;'>" + func.toString() + "</div"; report += "<div class='avgTime' style='font-weight: bold;margin: 0 0 0 10px'>" + name + ": " + avg + "ms</div>"; funcDiv.innerHTML = report; document.body.appendChild(funcDiv); }Here are the rules and results of all perfomance tests i run.
Javascript performance. Array vs Object