ExportXMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • DevProd Build
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It takes 8-9 seconds which you can really feel. I had an agent produce a report showing where the time goes. Much of it is going toward things that aren't actually about formatting, but would be better classified as linting (possibly with automated fixes) since they check and concern the semantics of the code, not just the layout/style. This is especially the case for validation of bazel files. It would be great if those could be pulled out lint, or in some cases (like adjusting the unittest groups) just having a nightly job that adjusts and autocommits.

      It also seems like it checks and validates buildozer and bazelisk multiple times which is likely a waste of time and could either be moved up to a higher level, or skipped entirely in the normal case.

      > time bazel run format
      INFO: running wrapper hook...
      INFO: pre-build generation: 443.2 ms
      INFO: Invocation ID: d7e6091f-542a-4257-a439-255120851ec2
      INFO: Streaming build results to: https://sodalite.cluster.engflow.com/invocation/d7e6091f-542a-4257-a439-255120851ec2
      INFO: Analyzed target //:format (3 packages loaded, 151 targets configured).
      INFO: Found 1 target...
      Target //bazel/format:rules_lint_format_wrapper up-to-date:
        bazel-bin/bazel/format/rules_lint_format_wrapper
      INFO: Elapsed time: 0.789s, Critical Path: 0.32s
      INFO: 1 process: 1 internal.
      INFO: Build completed successfully, 1 total action
      INFO: Running command line: bazel-bin/bazel/format/rules_lint_format_wrapper --prettier prettier_/prettier --rules-lint-format bazel/format/rules_lint_format.bash --rules-lint-format-check bazel/format/rules_lint_format.check.bash
      INFO: Streaming build results to: https://sodalite.cluster.engflow.com/invocation/d7e6091f-542a-4257-a439-255120851ec2
      Picked remote 'origin' with url 'git@github.com:10gen/mongo'
      Changed-file discovery took 0.106s
      Running BUILD-related validators
      Downloaded file ./buildozer already exists, validating...
      Validating against hard coded sha256: 0b5a2a717ac4fc911e1fec8d92af71dbb4fe95b10e5213da0cc3d56cea64a328
      validate_clang_tidy_configs took 0.022s
      Downloaded file ./buildozer already exists, validating...
      Validating against hard coded sha256: 0b5a2a717ac4fc911e1fec8d92af71dbb4fe95b10e5213da0cc3d56cea64a328
      Downloaded file ./buildozer already exists, validating...
      Validating against hard coded sha256: 0b5a2a717ac4fc911e1fec8d92af71dbb4fe95b10e5213da0cc3d56cea64a328
      Downloading bazelisk...
      Downloaded file ./bazelisk already exists, validating...
      Validating against hard coded sha256: 54f85ef4c23393f835252cc882e5fea596e8ef3c4c2056b059f8067cd19f0351
      Downloaded bazelisk to ./bazelisk
      Query all unittest binaries... 0.66s
      Query all mongo_unittest_first_group unittests... 0.45s
      Query all mongo_unittest_second_group unittests... 0.54s
      Query all mongo_unittest_third_group unittests... 0.37s
      Query all mongo_unittest_fourth_group unittests... 0.42s
      Query all mongo_unittest_fifth_group unittests... 0.37s
      Query all mongo_unittest_sixth_group unittests... 0.35s
      Query all mongo_unittest_seventh_group unittests... 0.34s
      Query all mongo_unittest_eighth_group unittests... 0.32s
      validate_bazel_groups took 3.835s
      Downloaded file ./buildozer already exists, validating...
      Validating against hard coded sha256: 0b5a2a717ac4fc911e1fec8d92af71dbb4fe95b10e5213da0cc3d56cea64a328
      Downloading bazelisk...
      Downloaded file ./bazelisk already exists, validating...
      Validating against hard coded sha256: 54f85ef4c23393f835252cc882e5fea596e8ef3c4c2056b059f8067cd19f0351
      Downloaded bazelisk to ./bazelisk
      Query upstream tcmalloc cc_tests... 0.33s
      Query tagged tcmalloc shadow tests... 0.29s
      validate_tcmalloc_cc_test_coverage took 0.631s
      Downloaded file ./buildozer already exists, validating...
      Validating against hard coded sha256: 0b5a2a717ac4fc911e1fec8d92af71dbb4fe95b10e5213da0cc3d56cea64a328
      Downloading bazelisk...
      Downloaded file ./bazelisk already exists, validating...
      Validating against hard coded sha256: 54f85ef4c23393f835252cc882e5fea596e8ef3c4c2056b059f8067cd19f0351
      Downloaded bazelisk to ./bazelisk
      validate_idl_naming took 0.383s
      Downloaded file ./buildozer already exists, validating...
      Validating against hard coded sha256: 0b5a2a717ac4fc911e1fec8d92af71dbb4fe95b10e5213da0cc3d56cea64a328
      validate_private_headers took 0.358s
      BUILD-related validators took 5.231s
      Running prettier
      prettier took 0.316s
      Running rules_lint formatter
      Formatted JavaScript in 0m0.097s
      Formatted JSON in 0m0.080s
      Formatted Markdown in 0m0.170s
      Formatted HTML in 0m0.098s
      13 files left unchanged
      Formatted Python in 0m0.008s
      Formatted Starlark in 0m0.006s
      Formatted Shell in 0m0.004s
      Formatted C in 0m0.102s
      Formatted C++ in 0m0.064s
      rules_lint formatter took 1.190s
      bazel run format  4.76s user 1.90s system 73% cpu 9.056 total
      

      (the agent added a bit of extra timing checks when making its report, but I undid those changes and can't copy from those runs anymore)

            Assignee:
            Daniel Moody
            Reporter:
            Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: