Skip to content

Long runtime classpaths slow down unit test execution #19480

@rsalvador

Description

@rsalvador

Description of the bug:

The classpath pre-processing loop in java_stub_template.txt is inefficient for very long classpaths and slows down unit test execution. The slowdown is in this loop in java_stub_template.txt:

for classpaths with ~250,000 and ~700,000 entries the loop takes 28 and 50 seconds, respectively, on an intel MacBook.

Which category does this issue belong to?

Performance

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Run a unit test with a very long runtime classpath.

Which operating system are you running Bazel on?

OSX

What is the output of bazel info release?

release 6.1.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

Performance regression seems to have been introduced in d0ee889

Have you found anything relevant by searching the web?

No

Any other information, logs, or outputs that you want to share?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions