michelson / BigBroda

GoogleBig Query ActiveRecord Adapter & API client
MIT License
113 stars 16 forks source link

PERFORMANCE: JSON vs Oj #14

Open lgs opened 10 years ago

lgs commented 10 years ago

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 commented 10 years ago

... have a look at some gists

michelson commented 10 years ago

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

otobrglez commented 9 years ago

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

michelson commented 9 years ago

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