Bug 151697 PDF Render performance enhancement
When trying to find out why our reports were taking so long to render to pdf (itext) we found out that a simple fix would allow them to run 5 to 6 times faster. Using TPTP we found out that a significant part of the time spent in the rendering process was at the constructor of org.eclipse.birt.report.engine.layout.area.impl.TextArea That constructor runs several initialization methods of the owned Style instance, using a constant as parameter style.setXXXX(CSSConstants.CSS_NONE_VALUE). Each of this methods of org.eclipse.birt.report.engine.css.dom.AbstractStyle invoke a method setCssText(int index,String cssText ) that will go througth a process of parsing , etc . This can be changed at the begining of the method checking it the input parameter is CSSConstants.CSS_NONE_VALUE, and if true just return CSSValueConstants.NUMBER_0. public void setCssText( int index, String cssText ) { //begin fix if (CSSConstants.CSS_NONE_VALUE.equals(cssText)) { setProperty( index,CSSValueConstants.NUMBER_0); return; } //end fix if ( cssText != null ) { ...... Something similiar can be done at the begining of method parsePropertyValue(int idx, String value) from the the class CSSValue public CSSValue parsePropertyValue(int idx, String value) { //begin fix if (CSSConstants.CSS_NONE_VALUE.equals(value)) return CSSValueConstants.NUMBER_0; //end fix assert idx >= 0 && idx < pm.getNumberOfProperties(); ...... This change of the code we come from 20 minutes to 3:15 on a ~1200 pages pdf. A similiar improvement as noticed much smaller reports. As this is a so simple change and didn't attached the code. Thanks Joao
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/layout/pdf/util/HTML2Content.java
protected String rootPath;
	
	protected Stack inlineContainerStack = new Stack();
	
	static
	{
		tag2Style.put( "code", 
				"font-family: monospace"); 
		
		tag2Style.put( "em", 
				"font-style: italic"); 
		tag2Style.put( "h1", 
			"font-size: 2em; margin-top: 0.67em; margin-bottom:0.67em; font-weight: bold; page-break-after: avoid"); 
		tag2Style.put( "h2", 
			"font-size: 1.5em; margin-top: 0.75em; margin-bottom:0.75em; font-weight: bold; page-break-after: avoid"); 
		tag2Style.put( "h3", 
			"font-size: 1.17em; margin-top: 0.83em; margin-bottom:0.83em; font-weight: bold; page-break-after: avoid"); 
	
		tag2Style.put( "h4", 
			"font-size: 1.12em; margin-top: 1.12em; margin-bottom:1.12em; font-weight: bold; page-break-after: avoid"); 
	
		tag2Style.put( "h5", 
			"font-size: 0.83em; margin-top: 1.5em; margin-bottom:1.5em; font-weight: bold; page-break-after: avoid"); 
	
		tag2Style.put( "h6", 
			"font-size: 0.75em; margin-top: 1.67em; margin-bottom:1.67em; font-weight: bold; page-break-after: avoid"); 
		tag2Style.put( "pre", 
				"font-family: monospace; white-space: no-wrap; "); 
		tag2Style.put( "strong",