Comment

Comment by raphaelrk

Speaking of python performance, I recently benchmarked "numpy vs js" matrix multiplication performance, and was surprised to find js significantly outperforming numpy. For multiplying two 512x512 matrices:

    python
      numpy:               ~3.30ms
      numpy with numba:    ~2.90ms

    node
      tfjs:                ~1.00ms
      gpu.js:              ~4.00ms
      ndarray:           ~118.00ms
      vanilla loop:      ~138.00ms
      mathjs:           ~1876.00ms

    browser
      tfjs webgpu:          ~.16ms
      tfjs webgl:           ~.76ms
      tfjs wasm:           ~2.51ms
      gpu.js:              ~6.00ms
      tfjs cpu:          ~244.65ms
      mathjs:           ~3469.00ms

    c
      accelerate.h:         ~.06ms

Source here: https://github.com/raphaelrk/matrix-mul-test
parent raphaelrk 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton