Tracing np.add, all the way down

(blog.veitheller.de)

18 points | by luu 4 days ago

2 comments

  • nomel 1 minute ago
    > “it adds the arrays, in C, quickly”

    The correct mental model would be "it adds the C arrays, in C, quickly". ;)

    If you pass it python lists, in a tight loop, it's going to be near orders of magnitude slower, for something like an add, regardless of item count. This is a mistake I often see with an attempt to "we'll just make it faster with numpy!"

  • tonnydourado 56 minutes ago
    That was some lovely spelunking XD