BigBroda icon indicating copy to clipboard operation
BigBroda copied to clipboard

PERFORMANCE: JSON vs Oj

Open lgs opened this issue 11 years ago • 4 comments

I notice that BB make extensive use of JSON standard lib. Shouldn't be better to wire in Oj instead ?

./lib/google_bigquery/jobs.rb

      job_id = JSON.parse(res.body)["jobReference"]["jobId"]
        status = JSON.parse(self.get(project_id, job_id).body)
      job_id = JSON.parse(res.body)["jobReference"]["jobId"]
        status = JSON.parse(self.get(project_id, job_id).body)

./lib/google_bigquery/client.rb

      JSON.parse(res.body)
      JSON.parse(res.body)
      body = JSON.parse(@results.body)
      body = JSON.parse(res.body)

./lib/active_record/connection_adapters/bigquery_adapter.rb

          json = JSON.parse(file.read)

lgs avatar Oct 21 '14 19:10 lgs

... have a look at some gists

lgs avatar Oct 21 '14 19:10 lgs

@lgs , interesting, it's almost twice fast! it could be a good alternative

michelson avatar Oct 22 '14 03:10 michelson

Has there been any work done on Oj implementation by anyone?

otobrglez avatar Jan 21 '15 08:01 otobrglez

Hello @otobrglez , there has been no progress on this. It seems to be a really good alternative, but right now I don't have the time to work on this. If you are interested maybe you could implement Oj in BigBroda ? , I will be happy to merge any progress on this.

Best regards

michelson avatar Jan 21 '15 11:01 michelson