supermetrics-public/pecl-jsonpath

Performance improvements?

mk6i opened this issue · 2 comments

mk6i commented

@crocodele I was wondering if you've seen any preliminary improvements in performance/resource usage by using this extension in your applications over PHP-based implementations?

@mkaminski1988, sorry for the long response time. We haven't plugged the extension into our applications yet – I will do that when we have the extension in a stable state that we know is free from segfaults and memory leaks. Not far away now. 🙂 But I have run one benchmark with a huge JSON file (200k rows, filesize 180MB), comparing the extension against a userland-PHP library as well as library-less array traversing in PHP. The results there are:

  • extension: 0.11 seconds
  • library-less traversing in PHP: 0.93 seconds
  • userland-PHP library: 4.1 seconds

I expect the differences to be smaller for smaller datasets, but the above is pretty impressive nevertheless!

My intention is to create a benchmark suite with small, medium, and large datasets as well as simple and complex JSONPath expressions (and the equivalent library-less PHP code).

mk6i commented

Awesome, thanks!