Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318421

Summary: Static weaving - please improve processing speed and performance
Product: z_Archived Reporter: Igor Mukhin <iimuhin>
Component: EclipselinkAssignee: Project Inbox <eclipselink.orm-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: martin.grebac
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Igor Mukhin CLA 2010-06-30 04:14:30 EDT
Build Identifier: 20100617-1415

We use static weaving while development. For each build we wait 40 seconds for static weaving to process 20 entities on 2,4Gh 2Core PC.

Can it be improved?

Reproducible: Always

Steps to Reproduce:
1. Create some entities (something like 20)
2. Create ant file for static weaving
3. Run it 1000 times.
4. Wait 11 hours (40 sec * 1000)
5. Hate it.
Comment 1 Igor Mukhin CLA 2010-06-30 10:51:49 EDT
I just found out that, it only happens if you weave to the same direcotry, where the original classes are.

If you weave to somewhere else, it lasts just 5 seconds.
Comment 2 Igor Mukhin CLA 2010-06-30 12:51:06 EDT
I found out that the problem only occurs on Windows XP. 
My colleague has Windows 7 and the weaving lasts 5 seconds.

So I coded the weaving for WinXP in this way:
- rename /classes to /unweaved_<timestamp>
- waave from /unweaved_<timestamp> to /weaved_<timestamp>
- move from /weaved_<timestamp> to /classes

Only that way it works fast on WinXP.
Comment 3 Igor Mukhin CLA 2010-06-30 12:53:33 EDT
The possible solution is may be to not use URLClassLoader in org.eclipse.persistence.tools.weaving.jpa.StaticWeaveProcessor in process().

The line is:
        this.classLoader = new URLClassLoader(getURLs(), this.classLoader);


May be there is a classLoader that doesn't lock the files.
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:08:33 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:16:06 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink