
Rubyist makes some Python code 5x Faster - mariuz
https://www.schneems.com/2017/10/02/lifelong-rubyist-makes-some-python-code-5x-faster/
======
est
I thought it was an insane CPython interpreter optimization or something.

Turns out it was a specific chunk of python snippet that

> determining all possible moves for a Queen piece on a chess-like board

~~~
devnonymous
Yep, that's what I thought as well and was curious to see the link between the
author being a rubyist and contributing to python. Too bad it wasn't any such
thing.

On the plus side tho', I thought the principles mentioned go beyond the
specifics of the code snippent which was being used more like an example.

The author being a rubyist has no influence to anything mentioned in the
article AFAICT.

------
fijal
It would be really good if the author actually linked to somewhere where you
can reproduce the benchmark. Either way, I'm pretty sure the correct response
is "use pypy", not that I can check it

------
devnonymous
Ugh, what's with the cheeky/inflammatory/click-baity title.

That's a turn off from an otherwise good article on guidelines one can use to
easily identify opportunities to potentially optimize python code.

~~~
digger250
Huh? I thought the title was a perfect description of the article. A dude who
mostly uses ruby optimizes a piece of Python code. That's it.

~~~
sidlls
The "rubyist" is completely irrelevant to the article. The optimizations might
apply as well in any number of languages, because they all are related to
minimizing heap allocations and keeping the execution pipeline lean (e.g. by
minimizing function calls).

It's fairly easy to think from the title that the article is going to be
something about how clever the rubyist is compared to Python programmers or
how slow Python is or some such, as an intrinsic property of "rubyists" or
Python.

------
epmatsw
This is an assignment from Georgia Tech’s OMSCS 6601 class, Intro to AI. This
was a super fun assignment, with lots of low hanging optimizations like this
:)

------
Xoros
The board contains only binary values. So why not use binary comparisons in
integers ?

For any row, you test the row value & the current col and have your answer.

------
stevebmark
A Rubyist? Ruby is a nice language but because of its core design flaw of
metaprogramming there's no point in trying to squeeze optimizations out of
Ruby code. It's slow by design.

~~~
dopamean
What on earth are you talking about?

