Fixed some unit test issues and improved BSON::ByteBuffer performance by 128 times

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 1.0.9
    • Affects Version/s: 1.0.8
    • Component/s: None
    • None
    • Environment:
      Ruby 1.9.2, Mac OS X
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I've fixed a bunch of deprecation warnings and Ruby 1.9.2 failures in the unit test suite.

      I've also improved the performance of BSON::ByteBuffer and BSON::Binary by 128x in the common use case where it is only used to wrap a binary data string but not otherwise modified. I used the following test:

      str = "hello world " * 1024
      result = Benchmark.measure do
      30_000.times do
      BSON::Binary.new(str)
      end
      end
      puts result

      Original run time: 9.4 seconds
      New run time: 0.07 seconds

      My changes can be found at the following Github pull request: http://github.com/mongodb/mongo-ruby-driver/pull/2

            Assignee:
            Kyle Banker (Inactive)
            Reporter:
            Hongli Lai
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: