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

LTW classloader lock prevents multi-thread usage #23

Open
SampadSikder opened this issue Jan 27, 2025 · 2 comments
Open

LTW classloader lock prevents multi-thread usage #23

SampadSikder opened this issue Jan 27, 2025 · 2 comments

Comments

@SampadSikder
Copy link
Owner

Hello.
In our project we use LTW in development process. Recently we improved one of the part of our application to use multiple thread to load classes (to speed up application start). But results of parallelizing is far from idea. Threads were mostly blocked by this lock:
https://github.com/eclipse/org.aspectj/blob/063d3cc59aad88f02bc82bc6e417a828dae9ef2d/loadtime/src/main/java/org/aspectj/weaver/loadtime/Aj.java#L99

@SampadSikder
Copy link
Owner Author

@SampadSikder
Copy link
Owner Author

Okay, let's analyze the provided data to find the most common top 10 files between the two lists.

File 1:

  1. org.aspectj.testing.harness.bridge.JavaRun.java
  2. org.aspectj.weaver.ltw.LTWWorld.java
  3. org.aspectj.internal.tools.ant.taskdefs.MainWrapper.java
  4. org.aspectj.ajde.Ajde.java
  5. org.aspectj.tools.ajc.AjcTestCase.java
  6. org.aspectj.systemtest.ajc152.SynchronizationTests.java
  7. org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.java
  8. org.aspectj.weaver.bcel.ClassLoaderRepositoryTest.java
  9. org.aspectj.util.LangUtil.java
  10. org.aspectj.weaver.loadtime.Aj.java

File 2:

  1. Blob.java
  2. org.aspectj.systemtest.ajc152.SynchronizationTests.java
  3. de.scrum_master.app.Application.java
  4. Application.java
  5. org.aspectj.tools.ajc.AjcTestCase.java
  6. org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.java
  7. org.aspectj.testing.AntSpec.java
  8. NestedSynchronized.java
  9. org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptorTest.java
  10. org.aspectj.weaver.loadtime.WeavingURLClassLoaderTest.java

Finding Common Top 10s

Now, let's identify the files that appear in the top 10 of both lists:

  1. org.aspectj.systemtest.ajc152.SynchronizationTests.java
  2. org.aspectj.tools.ajc.AjcTestCase.java
  3. org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.java

Therefore, the most common files appearing in the top 10 of both lists are:

  1. org.aspectj.systemtest.ajc152.SynchronizationTests.java
  2. org.aspectj.tools.ajc.AjcTestCase.java
  3. org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.java

Important Note: It is impossible to have 10 common elements since the first dataset has 10 elements and the second dataset has 10 different elements with the exception of 3 duplicate elements.

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

No branches or pull requests

1 participant