Re:J Notation as a Tool of Thought
by worc3131 on Saturday August 15, 2020 @04:47PM
(#24172247)
It doesn't quite seem fair to compare numpy to one of the most famous K code golf's ever created, but here is my attempt, 140 characters compared to Arthur's 30, so 5 times longer. Not worry about padding the edges would cut it to 100. I don't think the gap is as wide as you think it is.
Speedtest (presumably memory bound):
Interestingly the K code is designed to return a boolean matrix, but operates much more slowly for me on a boolean matrix compared to an integer matrix, with the result that:
Takes 1.2 seconds whilst
Takes 24 seconds. So whilst the idea seems to be that klife is used with scan/over to run a number of iterations, it's actually a bad idea to run it more than once.
[ Parent
| on HN ]
There are no comments on this comment yet.