background preloader

Performance Profiler for Node.js

Performance Profiler for Node.js

Update on my Node.js Memory and GC Benchmark - Hannes Wallnöfer Posted on 29 September 2010 I was lucky enough to have a short chat with Ryan at JSConf.eu last weekend in Berlin about the memory allocation comparison between Node.js and RingoJS I had done. He didn’t have any suggestion for tuning Node.js or V8 for higher memory and garbage collector throughput, but thought it was possible that Node’s lackluster performance in the benchmark had to do with binary buffers and getting data in and out of them. Thinking about a memory and garbage collection benchmark that didn’t involve buffers quickly led me to JSON. Parsing JSON is a fairly frequent task for a web application, and it can put a considerable load on the garbage collector. Also, from my work on the Rhino JSON parser I knew that it is comparable in speed to V8’s (something that unfortunately isn’t true of, say, RegExp implementations), so the results would reflect GC performance pretty well. Here’s the source code of the JSON parsing benchmark I wrote. Notes

JavaScript | Mozilla Developer Network JavaScript (JS) is a lightweight interpreted (or just-in-time compiled) programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as Node.js, Apache CouchDB and Adobe Acrobat. JavaScript is a prototype-based, multi-paradigm, single-threaded, dynamic language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles. JavaScript's dynamic capabilities include runtime object construction, variable parameter lists, function variables, dynamic script creation (via eval), object introspection (via for...in and Object utilities), and source-code recovery (JavaScript functions store their source text and can be retrieved through toString()). This section is dedicated to the JavaScript language itself, and not the parts that are specific to Web pages or other host environments. Looking to become a front-end web developer? Get started

Blazing fast node.js: 10 performance tips from LinkedIn Mobile In a previous post, we discussed how we test LinkedIn's mobile stack, including our Node.js mobile server. Today, we’ll tell you how we make this mobile server fast. Here are our top 10 performance takeaways for working with Node.js: 1. By design, Node.js is single threaded. Unfortunately, it is still possible to make synchronous/blocking calls. Our initial logging implementation accidentally included a synchronous call to write to disc. 2. The Node.js http client automatically uses socket pooling: by default, this limits you to 5 sockets per host. 3. For static assets, such as CSS and images, use a standard webserver instead of Node.js. 4. Let's quickly compare rendering a page server-side vs. client-side. Note that everything on this page, except for the user's name, is static: that is, it's identical for every user and page reload. The rest of the page - all the static HTML markup - can be put into a JavaScript template (such as an underscore.js template): 5. 6. 7. 8. 9. 10.

My Node.js Linksheet - Progstr Filer Recently I have been looking around the internet for various info about Node.js. At first, my intent was to make some sort of infographic on the topic, but later I have changed my mind. I like infographics a lot, but they have an important limitation - their links aren't clickable. That is why I have decided to simply categorize the information and share it. Some companies, using Node.js 37Signals.com use Node.js to write Pow, zero configuration Rack server for OS/X. academia.edu uses Node for background data processing. appendto.com Dow Jones - The WSJ Social front-end is written completely in node, using Express, ejs, and many other modules. duckduckgo.com uses it for XMPP bot im@ddg.gg. ebay.com uses Node.js in ql.io An HTTP gateway. ge.tt is a file sharing service. heroku.com use Node for internal tools. joyent.com is the basic supporter of Node.js. klout.com livechat.com gomockingbird.com is using Node.js and operational transformations to do real-time, collaborative wireframing. Yahoo!

Brief git guide Git is handy version control for collaborative development and testing. This guides you briefly through basics to get started. Only terminal usage under GNU / Linux is covered, for graphical user interfaces please refer guides available at web. Note - this was not placed under developer nor testing because it's common for all MeeGo contributors. Concepts Please open the excellent git cheat sheet . 1. git clone <repository> Example: git clone 2. 3. git add <newfile> (if you created new file) git commit -a Your default editor is opened and you need to write description of changes. 4. git push (this assumes you have commit rights to repository, please check with repository admin) That's it! Pre-steps Mandatory - Make sure you have git installed Debian /Ubuntu: sudo apt-get install git Optional - If working behind ssh-proxy If you are working with corporation you might need to resolve ssh-proxy challenge. Run the following command:

6 Must Have Node.js Modulesblog So you're thinking about using node.js: awesome. If you're new to the community you're probably thinking "what's the best node.js module / library for X?" I think it's really true when experienced language gurus say "80% of your favorite language is your favorite library." cradle: A high-level, caching, CouchDB library for Node.js findit: Walk a directory tree in node.js node_redis: Redis client for node node-static: RFC2616 compliant HTTP static-file server module, with built-in caching. optimist: Light-weight option parsing for node.js xml2js: Simple XML to JavaScript object converter. If you're using CouchDB you should be using cradle. A common set of problems that I see on the nodejs mailing list are advanced file system operations: watching all the files in a directory, enumerating an entire directory, etc. There have been a lot of redis clients released for node.js. Redis is really fast, and extremely useful for storing volatile information like sessions and cached data. #! $ . <?

Max Ogden Blogotronz Description of and notes on the node.js Stream API There is also a screencast version of this article. node bills itself as JavaScript evented I/O. "Streams in node are one of the rare occasions when doing something the fast way is actually easier. -@dominictarr in his high level node style guide The main tool in node's evented toolbox is the Stream. Readable Readable streams will emit data events each time they get a "chunk" of data and then they will emit end when they are all finished. emit (from EventEmitter) is the observer pattern - a publish/subscribe pattern which allows a number of observer objects to see an event. Readable streams can also be paused and resumed, and it's up to the Stream implementer to write the pause() and resume() methods. Writable Writable streams must implement two functions: write and end. This is a form of back pressure which is a very powerful feature as it lets stream communicate "upstream" to their writers. Simplified writable stream

Git First of all, you'll need to have Git installed on your machine, whether through the support of your IDE, or as a command-line tool. If you want to checkout the source code of Groovy, there are three different URLs you can use. From the command-line, you can use the command: git clone git: ?? git clone https: git clone git@github.com:groovy/groovy-core.git You can checkout different branches, in particular: master is the latest Groovy branch, for the upcoming major versionGROOVY_1_8_X is the branch of the curret Groovy 1.8.x versions (current stable version)GROOVY_1_7_X is the branch for the previous official version of Groovy 1.7.x For fetching a branch the first time, simply use: To checkout a particular branch: git checkout master git checkout GROOVY_1_8_X git checkout GROOVY_1_7_X Icon Developers: Make sure your SSH information is up-to-date on Github or on Codehaus Xircles and that your SSH key is available to your command-line client or IDE integration. git commit -m "Your commit message"

Felix's Node.js Convincing the boss guide « Home / All Guides Now that you're all hyped up about using node.js, it's time to convince your boss. Well, maybe. So this guide is my opinionated collection of advice for those of you that want to explore whether node.js makes sense for their business, and if so, how to convince the management. Bad Use Cases CPU heavy apps Even though I love node.js, there are several use cases where it simply doesn't make sense. That being said, node.js allows you to easily write C++ addons, so you could certainly use it as a scripting engine on top of your super-secret algorithms. Simple CRUD / HTML apps While node.js will eventually be a fun tool for writing all kinds of web applications, you shouldn't expect it to provide you with more benefits than PHP, Ruby or Python at this point. The truth is that while we are starting to see good frameworks for node.js, there is nothing as powerful as Rails, CakePHP or Django on the scene yet. NoSQL + Node.js + Buzzword Bullshit Good Use Cases JSON APIs Performance

Related: