Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can somebody explain the end of lecture?

Why Ruby and PyPy looks similar in this benchmark?



The bug that caused Ruby to run slow on that benchmark turned out to be one that afflicted earlier versions of Python. It's a priority inversion problem related to the GIL.

GIL: The global interpreter lock, basically a single lock that threads running in Python or Ruby synchronize on frequently to sync up, which causes problems in multithreaded applications.

Priority inversion: I don't think I'm qualified to explain this clearly, so I'll defer to wikipedia: https://en.wikipedia.org/wiki/Priority_inversion

The later slide where he showed PyPy having terrible performance on a benchmark where the other two code bases worked fine was an unrelated problem.

His point was that whereas he was able to dig into the Ruby implementation and figure out why it was running slow, it was much harder to find the reason why PyPy was not performing as it should due to the implementation complexity.

It is basically tying back to the analogy of the VW versus the Porsche. He could often fix his VW using a pocket knife, which would be very difficult to do with a Porsche.


Yeah, he skipped over what might have been the most interesting part of the talk! I have a very cursory understanding of how the GIL works, so it would be nice to understand what's going on here.


He referenced a previous talk about the GIL:

http://blip.tv/rupy-strongly-dynamic-conference/david-beazly...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: