Comment

Comment by andor

It completely depends on the application. I have yet to see a use case that benefits from PyPy. Here's an example I tried with CPython2, 3 and PyPy yesterday: It loads the most probable translations for all unigrams from a Moses phrase translation table (11GB) into a dict, and using that dict translates 73 MB of text word by word. Most of the time is spent filling the dict/reading the large file.

  $ time python literal_translation.py phrase-table en test4
  translation table contains 76885 elements
  ...................................................................... 070
  .......................................................
  125 files translated
  
  real	1m14.345s
  user	1m9.836s
  sys	0m4.157s
  
  
  $ time python3 literal_translation.py phrase-table en test5
  translation table contains 76885 elements
  ...................................................................... 070
  .......................................................
  125 files translated
  
  real	2m17.680s
  user	2m2.605s
  sys	0m4.987s
  
  
  $ time pypy literal_translation.py phrase-table en test6
  translation table contains 76885 elements
  ...................................................................... 070
  .......................................................
  125 files translated
  
  real	1m13.347s
  user	1m0.033s
  sys	0m4.734s

https://gist.github.com/andreasf/af6bdc00cf5a928712b5
parent andor 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton