Tag Archives: javascript

Writing performant JavaScript – A Hacky thought using asm.js

Disclaimer: I haven’t tried this myself. Got this weird thought when going through some of the blogs.
The question is, how do you write a very performant Node JavaScript code?
If you have a node based microservice doing exactly just one thing and that too in the most efficient fashion. Once written such programs doesn’t have to be tweaked much and constitutes as a piece of framework based on which other components work (around it). It seems confusing, don’t worry, just think of a scenario in which you would want to write best performant Node code for your project.
Writing a high performant code is very difficult. One approach that I can think of is by generating the best possible JavaScript by converting well written C or C++ code using Emscripten. Crazy??
Sort of.. ­čÖé
Let me explain. ..
Have you heard of asm.js? If not, its a subset of JavaScript which is very efficient and can be one of the JS written very close to native code. It performs very close to how native code works. Generally its not hand written, rather it is generated.
The C or C++ code which is written (considering all the best practices) is passed to Emscripten which converts into asm.js code. Sound Greek?
Ok, let me get into a bit more detail… first you write C or C++ code and then it is converted to so called LLVM byte code. Now you will think what the hell is LLVM. LLVM (Low Level Virtual Machine) is what it started off years ago. But, now it has so many sub projects under its umbrella and it no more like its abbreviation. Using Clang you convert the C or C++ code to LLVM bytecode and then pass it onto Emcripten which converts LLVM bytecode to highly performant JavaScript code (asm.js).
So, this can be thought off as an approach to write some performing Node (JavaScript) code which runs itself as a microservice.
If you feel confused at this stage, dont worry. Just grasp some of the important points as below:
  • asm.js – strict subset of JavaScript which is highly performant. At the end of the day, its plain JavaScript.
  • LLVM – C or C++ code is converted to LLVM bytecode using Clang.
  • Emscripten – Takes in LLVM bytecode and converts into asm.js.
Let me know your thoughts using the comment section.
If you feel this is quite good thought, spread the word using various social networks by clicking on appropriate icons.
Shameless Advertisement/Promotion… ­čÖé
Would you like to read a book on Data Lake (Big Data)? I am co-author of a book named “Data Lake for Enterprises” published by Packt Publishing.
You can buy in Amazon here.
If you would like to see more on what is there in this book, please visit the book’s dedicated website here.

Page Visitors: 104

JavaScript Database Library – Part 2

Earlier I wrote a post in which I tried to cover as much libraries as possible in the space of “JavaScript Database Library”. Later on I realized that that was in no way a complete list. When I research more, I could see another set of libraries as detailed below, which falls into the same category. Still I am not claiming that the list is exhaustive, but at least it gives various options we have in hand before selecting one for your application development.

Missed ones:
1. story.js – https://github.com/gilf/story.js
2. persistence.js
3. persistJS
4. amplify.store
5. localStorageDB
6. realStorage
7. YUI3 CacheOffline
8. DomSQL
9. Impel
10. ActiveJSActiveRecord
11. JazzRecord
12. picnet.data.DataManager
13. ShinyCar
14. lscache
15. microcache.js

One day I hope to write at least a small abstract on each one of these and also create some matrices which can be used meaningfully to select a particular library for your application.

Page Visitors: 80

JavaScript Database Library – Part 1

JavaScript is a universal language now. Its popularity, usage and its capabilities will keep increasing day by day. The future of especially web application development is in the hands of JavaScript and its various libraries and frameworks.

With node.js, JavaScript has also captured the niche server side as well in storm. In distant future, just by knowing JavaScript you would be bale to code an entire web application, both server and client side with ease.
This post, i cannot call as a very good blog post, but i just wanted to share the list of JavaScript database libraries i just searched using Google. Some of them might not be that useful a library as of now but can go on become more mature down the line.

The below lists some of the JavaScript database library:

TaffyDB – http://www.taffydb.com/
Lawnchair – http://brian.io/lawnchair/
Storjsdb – http://code.google.com/p/storjsdb/
Jstorage – http://www.jstorage.info/
SQLite – http://www.sqlite.org/
YDN-DB – http://dev.yathit.com/ydn-db/index.html
PouchDB – http://pouchdb.com/
Loki.js – http://lokijs.org/
XBSDB – http://xbsdb.org/
Store.js – https://github.com/marcuswestin/store.js
Sql.js – https://github.com/kripken/sql.js/
BankersBox – https://github.com/twilio/BankersBox
IDBWrapper – http://jensarps.github.io/IDBWrapper/
JayData – http://jaydata.org/
Kizzy – https://github.com/ded/Kizzy
Artemia – https://github.com/js-experiments/artemia
Strg.js – https://github.com/fend25/strg.js
localForage – https://github.com/mozilla/localForage
Rhaboo – http://adrianmay.github.io/rhaboo/

The above list was gathered from mere Googling and by reading through below sites:

These sites lists most of the JavaScript libraries which exists around the world written by awesome people.

Now the big question, which one should i use or standardize as the best one to develop a medium web application?
I don’t know, if anyone can help me, please drop me a comment and i will try to collate it and put another post, which would be more relevant and meaningful a post fr others.

Page Visitors: 189