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

Bug 119146

Summary: Republish takes forever
Product: [WebTools] WTP ServerTools Reporter: Igor Fedorenko <igor>
Component: wst.serverAssignee: wst.server <wst.server-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 1.5   
Target Milestone: 1.5 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
sample WAR project with 5000 JSPs in one folder (TAR GZ)
none
proposed fix none

Description Igor Fedorenko CLA 2005-12-02 18:59:44 EST
This is a reincarnation of bug 110898. WTP 1.0RC1, start fresh workspace, create Tomcat 5.5 runtime and server config, import "war" project (will attach shortly) into the workspace. Add "war" project to the server. Publish. Publish again. Problem: second publish takes forever (killed WTP after waitinf for 5 minutes on my T42 ThinkPad).

The problem seems to be caused by "look for duplicates" loop in ServerPublishInfo#getDelta(IModuleResource[], IModuleResource[]) which compares all new resources against all old resources. Our app has a folder with 5000+ files in it (generated java code with extensivle use of nested classes), so the loop results in >25M iterations...
Comment 1 Igor Fedorenko CLA 2005-12-02 19:01:31 EST
Created attachment 31087 [details]
sample WAR project with 5000 JSPs in one folder (TAR GZ)
Comment 2 Igor Fedorenko CLA 2005-12-03 02:52:52 EST
Created attachment 31092 [details]
proposed fix

Faster implementation of #getDelta and #hasDeltar methods. I've written few unit tests for #getDelta and new implementation appears to return same results as the old one, only much faster ;-). Publish to Tomcat also appears to work fine. I have not explicitly tested new implementation of #hasDelta. Hope this helps.
Comment 3 Tim deBoer CLA 2005-12-05 16:48:32 EST
Thanks for making it easy for me - I reproduced the problem, applied and tweaked the fix a little, tested, and released to RC2.
Comment 4 David Williams CLA 2006-03-04 01:04:32 EST
This change is a bulk update of all _un_targeted, fixed, resolved bugs upon release of M5. This particular bug _might_ have been fixed earlier than M5. (Feel free to correct). 

Comment 5 Igor Fedorenko CLA 2006-06-26 22:54:41 EDT
verified
Comment 6 Tim deBoer CLA 2006-11-21 14:45:16 EST
Closing old bugs.