tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Rewriting pkglint in a portable language



Roland Illig wrote:
> For benchmarking the speed, I wrote a recursive grep in Go, Vala, Genie
> and Nim, and compared that to the native grep. I chose this simple task
> because pkglint heavily depends on IO and parsing text files. The Vala
> version was about 50 percent slower than the Go version, which in turn
> had half the speed of the native grep.

My friend Ewan wrote csv parsing in many languages to compare
performance. It's interesting how it all got started:

https://bitbucket.org/ewanhiggs/csv-game

   The CSV Game is a collection of examples of csv parsing programs
   which have two tests: report the number of fields in a csv file
   and take the sum of the values in a single column. It began when
   I saw this Rob Miller talk from GopherCon 2014 about Hekka where
   he claims that Go is so slow at parsing CSV messages that they
   pass the data over protocol buffers to a luajit process which
   parses the message and sends the data back over protocol buffers
   - and it's quicker than just reading it in Go (14:45 in the
   video). I could hardly believe this so I wrote some sample code
   myself to check it. Sure enough, I found Go to be pretty slow
   at parsing CSV files.

I can confirm that LuaJIT can be as fast as C++. I completed two
small interview projects in C++ and LuaJIT when I was looking for
a new job. One project was a bit similar to (non-recursive) grep.
While both C++ and LuaJIT were several times slower than grep,
LuaJIT was only 1.2 times slower than C++. In the other project,
LuaJIT had the same speed as C++ despite the fact that one function
wasn't jitted.

Alex


Home | Main Index | Thread Index | Old Index