node.js vs php & apache
En la investigacion de node.js, obviamente busque algunas comparaciones con el viejo y poco querido PHP.
Obviamente intuia que el server de node.js era mucho mas rapido que apache, pero no tenia tiempo de hacer las pruebas, es por eso que busque en internet que se habia hecho al respecto, y aca dejo los datos.
Primero una comparativa de las tecnologias
| Apache, PHP | node.js | |
| syntax | Additional language to web standard ECMA script try to use common structures |
One language to rule them all = reuse parts of your framework on the client side |
| strings | ‘line line’ |
‘line\nline’ or “line\n\ line” |
| templates | <code><?php // code ?></code> | var s = ‘<code>’; // code s += ‘</code>’; // send response http://github.com/creationix/microtemplates |
| database interface | PDO + prepared Statements (includes class instance support) | Still no prepared statements, 1.5 – 3x slower Driver update |
| performance | faster | |
| unicode | PCRE | no Unicode Character Properties / Scripts / Blocks in RegExp (only \w, \W consider Unicode whitespace) add chars manually to regexp |
| order | no namespaces up to 5.3 |
simple modules / namespaces |
| serving files | Apache serves static files | Overhead to serve static files Use additional webserver (nginx) or included in web framework |
| access | Only synchronous access … but easier code |
Asynchronous access via closures … highly nested code http://github.com/creationix/step |
| OOP | implicit memoization via __get() and reuse of requested key | getters (/setters) must access key with other name, bad for iteration or JSON notation |
| platform | many reliable extensions | many extensions still experimental … but the community is dynamic |
| PostGIS/Postgres | MongoDB | CouchDB | |
| GIS functionality | rich | just stuff based on points | few |
| stable | yes | yes | probably |
| GIS standards | full OpenGIS support (except for GeomColl in relational functions, workaround functions) | no OpenGIS at all, just points | full excepting for GeomColl |
| GIS indexing | no GeomColl index single geoms |
yes | yes |
| GIS performance | fast |
Fuente: https://docs.google.com/View?id=dfzvhszt_30drxqrvhk
Comparativa de rendimiento
Number of requests performed: 2000
Number of multiple requests made: 50
Number of requests performed: 2000Number of multiple requests made: 100
Number of requests performed: 2000
Number of multiple requests made: 150
Fuente: http://ricallinson.com/nodejs-ash-vs-php-symfony-vs-php-codeigniter
Seguire mi investigacon, cada vez me convenso mas de que node.js tiene un gran futuro.









Recent Comments