)]}'
{
  "commit": "f0c3b2368478af977e9c2ebe931b7fa92276ac55",
  "tree": "db94992836d18367d010b46eef32ca81ee0fd635",
  "parents": [
    "4e391c36c1d1d9c5fb59f3fbc8b7481ac82416a2"
  ],
  "author": {
    "name": "Mike Vitus",
    "email": "vitus@google.com",
    "time": "Wed Feb 28 13:08:48 2018 -0800"
  },
  "committer": {
    "name": "Mike Vitus",
    "email": "vitus@google.com",
    "time": "Thu Mar 01 09:00:44 2018 -0800"
  },
  "message": "Increases the performance of the C++11 threading.\n\nPreviously, the thread ID was acquired and released on every iteration\nof the for loop.  The C++11 concurrent queue implementation is much\nslower than TBB\u0027s version and consequently this was a huge bottleneck.\n\nThis introduces another ParallelFor API which takes the thread ID as a\nparameter in the evaluation function.  This allows us to acquire and\nrelease the thread ID for each block of work which drastically improves\nthe performance.\n\nThis change brings us on par with OpenMP and TBB.  See below for a\ntiming comparison.  Note: in this example this CLs C++11 version is\nfaster to compute the residuals because TBB still must acquire the\nthread ID on every iteration, which has some overhead.\n\nTested by building and running tests for no threading, OpenMP, TBB, and\nC++11 threads.  Also ran bazel tests.\n\n./bin/bundle_adjuster --input\u003dproblem-744-543562-pre.txt --num_threads\u003d8\n\nC++11 @Head\nTime (in seconds):\n  Residual only evaluation           7.819692 (5)\n  Jacobian \u0026 residual evaluation    11.606063 (6)\n  Linear solver                     47.860195 (5)\nMinimizer                           70.877072\n\nTotal                               90.806338\n---------------------------------------------------\n\nC++11 (This CL)\nTime (in seconds):\n  Residual only evaluation           1.217500 (5)\n  Jacobian \u0026 residual evaluation     5.796112 (6)\n  Linear solver                     44.080873 (5)\nMinimizer                           54.635524\n\nTotal                               77.640072\n\n---------------------------------------------------\nOpenMP\nTime (in seconds):\n  Residual only evaluation           0.797023 (5)\n  Jacobian \u0026 residual evaluation     5.633916 (6)\n  Linear solver                     43.280020 (5)\nMinimizer                           53.199058\n\nTotal                               76.250861\n\n---------------------------------------------------\nTBB\nTime (in seconds):\n\n  Residual only evaluation           1.911095 (5)\n  Jacobian \u0026 residual evaluation     5.557807 (6)\n  Linear solver                     44.074680 (5)\nMinimizer                           55.002688\n\nTotal                               78.052687\n\n---------------------------------------------------\nNo Threads\n\nTime (in seconds):\n\n  Residual only evaluation           2.939212 (5)\n  Jacobian \u0026 residual evaluation    18.519874 (6)\n  Linear solver                     74.017837 (5)\nMinimizer                           98.980080\n\nTotal                              122.216391\n\nChange-Id: I3af959b0771bbdfe8cad8c13896191d6ac903181\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8b34bc14e69cd5a1931ec029874101776422404f",
      "old_mode": 33188,
      "old_path": "internal/ceres/covariance_impl.cc",
      "new_id": "d77e5e121899663d498e5a4f3a28339ac71a2c6b",
      "new_mode": 33188,
      "new_path": "internal/ceres/covariance_impl.cc"
    },
    {
      "type": "modify",
      "old_id": "603c609bf8d1ed0e8ec2059cde2f6a1054ef96cb",
      "old_mode": 33188,
      "old_path": "internal/ceres/parallel_for.h",
      "new_id": "e54a1b36355a96b5fc8370b6bb1e06d4cabd77a8",
      "new_mode": 33188,
      "new_path": "internal/ceres/parallel_for.h"
    },
    {
      "type": "modify",
      "old_id": "f03ddb278cbab70aa0911973c28408ffee418072",
      "old_mode": 33188,
      "old_path": "internal/ceres/parallel_for_cxx.cc",
      "new_id": "bfc8973c08017be8bd70e7aacc39363ee46c1b45",
      "new_mode": 33188,
      "new_path": "internal/ceres/parallel_for_cxx.cc"
    },
    {
      "type": "modify",
      "old_id": "82fbf100f6cfd49bcbc25965e7f4352f6e9ef76e",
      "old_mode": 33188,
      "old_path": "internal/ceres/parallel_for_tbb.cc",
      "new_id": "e235b506292faf73bfcd8b04adb9520f0726ce65",
      "new_mode": 33188,
      "new_path": "internal/ceres/parallel_for_tbb.cc"
    },
    {
      "type": "modify",
      "old_id": "a3cf2dcd783aae6db00bd375f499eb82661b1263",
      "old_mode": 33188,
      "old_path": "internal/ceres/parallel_for_test.cc",
      "new_id": "2de48657d7cef40106d89fbb3785540036e14d9d",
      "new_mode": 33188,
      "new_path": "internal/ceres/parallel_for_test.cc"
    },
    {
      "type": "modify",
      "old_id": "ca6090298346bdad9c4b5f9665289b660ac7a986",
      "old_mode": 33188,
      "old_path": "internal/ceres/program_evaluator.h",
      "new_id": "5986d81ac534cdfed4746c1607d24713e3fdc3f7",
      "new_mode": 33188,
      "new_path": "internal/ceres/program_evaluator.h"
    },
    {
      "type": "modify",
      "old_id": "ca8f30e9f3a43878573ba887ebb14f3bad7190e8",
      "old_mode": 33188,
      "old_path": "internal/ceres/schur_eliminator_impl.h",
      "new_id": "8baa03936d6db2882cfbd492769d1b2876e9d13f",
      "new_mode": 33188,
      "new_path": "internal/ceres/schur_eliminator_impl.h"
    },
    {
      "type": "modify",
      "old_id": "1aa81f20b7d52e3a6f3391c76c847fc49d495fbd",
      "old_mode": 33188,
      "old_path": "internal/ceres/thread_pool_test.cc",
      "new_id": "5485fe417cc4382dd4de9f263355b52507fe3375",
      "new_mode": 33188,
      "new_path": "internal/ceres/thread_pool_test.cc"
    },
    {
      "type": "modify",
      "old_id": "841d31273d0e4fe11d93ec8b932e7f1e57de877f",
      "old_mode": 33188,
      "old_path": "internal/ceres/thread_token_provider.h",
      "new_id": "e4c9cd838da752d117df82192dd79aef6b9b7e67",
      "new_mode": 33188,
      "new_path": "internal/ceres/thread_token_provider.h"
    }
  ]
}
