Live data from Hacker News

How we used Node.js to build real-time award flight search

blog.milewise.com

1–10 of 39 posts

Re: How we used Node.js to build real-time award flight search

#8
they'd do much better with twisted (python) than tornado. using Deferreds is nothing like opening keys with a beer bottle -- it makes a lot of sense.

and as a former ITA Software employee, i can scoff and say they aren't actually doing anything resembling flight search. they're just scraping websites and APIs. node.js might be fine for that, but so is anything else. at that level it's more a matter of preference than capability.

Re: How we used Node.js to build real-time award flight search

#10

Could you describe the difficulties you encountered with Tornado and asynchronous Python code?

Don't want to turn this into a Node.js/Python flame war (we love Python as well here at MileWise), but regarding asynchronous Python code:

It's more just an annoyance of the language. Specifically, anonymous functions are must easier in JavaScript, so it was just easier to write read and write maintainable code.

In Python, you are limited to only passing in simple lambda functions (although deferreds do get around this issue somewhat). It's not a show stopper but when combined with all the other advantages of Node.js, it just made the decision to switch a lot easier.

We also ran into a lot of issues related to poor garbage collection in Python and were using up a lot of memory. This was not related to dangling references but rather Python's permanent allocation of Integer and Float objects.

Finally, we just saw better performance out of V8 than Python (although we never tried anything else besides vanilla Python 2.6).

For our specific problem, Node.js worked well. It's not always the right solution. We will write a more detailed blog post soon with specifics of how we used Node.

Post reply on HN