To evaluate if Go json.Unmarshal()
is faster or slower than PHP json_decode()
for arbitrary JSON I decided to run a quick benchmark on my 2015 MacBook Pro (Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz).
I used this ~25Mb JSON file and ran the attached two program under Go 1.22
and PHP 8.3.2
, respectively.
My benchmarks were very unscientific but I was just looking for orders of magnitude.
Here are the results from three different runs, each: