Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue in picocontainer #2724

Closed
jkronegg opened this issue Apr 6, 2023 · 0 comments
Closed

Performance issue in picocontainer #2724

jkronegg opened this issue Apr 6, 2023 · 0 comments
Assignees
Labels
🐛 bug Defect / Bug

Comments

@jkronegg
Copy link
Contributor

jkronegg commented Apr 6, 2023

👓 What did you see?

When using the picocontainer, the picocontainer container is fully reconstructed for each test-case:

    public void start() {
        pico = new PicoBuilder()
                .withCaching()
                .withLifecycle()
                .build();
        for (Class<?> clazz : classes) {
            pico.addComponent(clazz);
        }
        pico.start();
    }

The impact is that the PicoFactory.start() method takes 3.2% of the total CPU time on my project with 446 test scenarios (about 170 ms).

This operation is slow because the picocontainer library inspects all classes at each container creation (see picocontainer/picocontainer#11).

✅ What did you expect to see?

I expect that picocontainer impact is not noticeable on the total CPU time.
This could be done easily by reusing the container in PicoFactory (the picocontainer library cannot be corrected because it is not maintained anymore since 2015).

📦 Which tool/library version are you using?

Cucumber JVM 7.11.2.

🔬 How could we reproduce it?

Steps to reproduce the behavior:

  1. Run any cucumber test based on picocontainer with consequent number of test scenarios (>100) with the IntelliJ Profiler
  2. Look the IntelliJ Profiler and look for PicoFactory.start() method : the flame graph tells the percentage of total CPU

📚 Any additional context?

The picocontainer library 2.x has not been updated since 2014 (http://picocontainer.com/). There is an unreleased picocontainer 3.x project which has no activity since 2014 as well (https://github.com/picocontainer/picocontainer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Defect / Bug
Projects
None yet
Development

No branches or pull requests

2 participants