[gs-bugs] [Bug 690250] Performance slower than other PCL s/w

bugs.ghostscript.com-bugzilla-daemon at ghostscript.com bugs.ghostscript.com-bugzilla-daemon at ghostscript.com
Thu Mar 12 14:08:16 PDT 2009


http://bugs.ghostscript.com/show_bug.cgi?id=690250





------- Additional Comments From henry.stiles at artifex.com  2009-03-12 14:08 -------
Latest profile from the original profile.  Detail on the bottleneck function
(see below) suggest a linear search of the rectangles may not be a good choice.
I think fixing that would be a good incremental step as it really doesn't
involve any tradeoffs.

# Report 0 - Session 11 - Time Profile of pcl6
SharkProfileViewer
# Generated from the visible portion of the outline view
- 19.8%, spot_into_trapezoids__aj_fd, pcl6
- 9.6%, gx_default_fill_trapezoid, pcl6
- 7.9%, fixed_mult_quo, pcl6
- 7.1%, accum_fill_rectangle, pcl6
- 6.2%, intersect_al, pcl6
- 4.9%, floor$fenv_access_off, libSystem.B.dylib
- 4.8%, i_free_object, pcl6
- 3.0%, gx_general_fill_path, pcl6
- 3.0%, i_alloc_struct, pcl6
- 2.8%, mem_mono_strip_tile_rectangle, pcl6
- 2.5%, fill_slant_adjust, pcl6
- 2.4%, gx_flattened_iterator__init_line, pcl6
- 2.2%, gs_rlineto, pcl6
- 2.1%, step_al, pcl6
- 1.8%, gx_flattened_iterator__next, pcl6
- 1.4%, add_lines, pcl6
- 1.3%, init_al, pcl6
- 1.3%, accum_alloc_rect, pcl6
- 1.2%, gz_path_add_line_notes, pcl6
- 1.2%, end_x_line, pcl6
- 1.2%, clip_enumerate_rest, pcl6


Detail on spot_into_trapezoids__aj_fd:

3.4%	1.0%	1543	    for (x = min_fixed, alp = ll->x_list; alp != 0; alp = nlp) {			
		1544		bool notend = false;			
5.2%	1.5%	1545		alp->x_current = alp->x_next;			
		1546				
6.3%	1.8%	1547		nlp = alp->next;			
5.7%	1.6%	1548		if (alp->end.y == y1 && alp->more_flattened) {			
		1549		    code = step_al(alp, true);			
		1550		    if (code < 0)			
		1551			return code;			
		1552		    alp->x_current = alp->x_next = alp->start.x;			
1.6%	0.5%	1553		    notend = (alp->end.y >= alp->start.y);			
		1554		}			
10.7%	3.1%	1555		if (alp->end.y > y1 || notend) {			
3.3%	1.0%	1556		    if (alp->x_next <= x)			
		1557			resort_x_line(alp);			
		1558		    else			
		1559			x = alp->x_next;			
		1560		} else {			
1.3%	10.2%	1561		    code = end_x_line(alp, ll, true);			
0.3%	0.1%	1562		    if (code < 0)			
		1563			return code;			
		1564		    if (!code) {			
1.2%	0.4%	1565			if (alp->x_next <= x)			
		1566			    resort_x_line(alp);			
		1567			else			
		1568			    x = alp->x_next;			
		1569		    }			
		1570		}			
		1571	    }			
0.4%	0.1%	1572	    if (ll->x_list != 0 && ll->fo->pseudo_rasterization) {			
		1573		/* Ensure that contacting vertical stems are properly ordered.			
		1574		   We don't want to unite contacting stems into			
		1575		   a single margin, because it can cause a dropout :			
		1576		   narrow stems are widened against a dropout, but 			
		1577		   an united wide one may be left unwidened.			
		1578		 */			
		1579		for (alp = ll->x_list; alp->next != 0; ) {			
		1580		    if (alp->start.x == alp->end.x &&			
		1581			alp->start.x == alp->next->start.x &&			
		1582			alp->next->start.x == alp->next->end.x &&			
		1583			alp->direction > alp->next->direction) {			
		1584			/* Exchange. */			
		1585			active_line *prev = alp->prev;			
		1586			active_line *next = alp->next;			
		1587			active_line *next2 = next->next;			
		1588			if (prev)			
		1589			    prev->next = next;			
		1590			else			
		1591			    ll->x_list = next;			
		1592			next->prev = prev;			
		1593			alp->prev = next;			
		1594			alp->next = next2;			
		1595			next->next = alp;			
		1596			if (next2)			
		1597			    next2->prev = alp;			
		1598		    } else			
		1599			alp = alp->next;			
		1600		}			
		1601	    }			
		1602	    return 0;			
		1603	}			
		1604				
		1605	/* Process horizontal segment of curves. */			
		1606	static inline int			
		1607	process_h_segments(line_list *ll, fixed y)			
		1608	{			
		1609	    active_line *alp, *nlp;			
		1610	    int code, inserted = 0;			
		1611				
2.9%	0.8%	1612	    for (alp = ll->x_list; alp != 0; alp = nlp) {			
2.8%	0.8%	1613		nlp = alp->next;			
2.4%	0.7%	1614		if (alp->start.y == y && alp->end.y == y) {			
1.0%	0.3%	1615		    if (ll->fo->pseudo_rasterization) {			
		1616			code = add_y_line_aux(NULL, NULL, &alp->start, &alp->end,
DIR_HORIZONTAL, ll);			
		1617			if (code < 0)			
		1618			    return code;			
		1619		    }			
		1620		    inserted = 1;			
		1621		}			
		1622	    }			
		1623	    return inserted;			
		1624	    /* After this should call move_al_by_y and step to the next band. */			
		1625	}			
		1626				
		1627	static inline int			
		1628	loop_fill_trap_np(const line_list *ll, const gs_fixed_edge *le, const
gs_fixed_edge *re, fixed y, fixed y1)			
		1629	{			
		1630	    const fill_options * const fo = ll->fo;			
1.0%	0.3%	1631	    fixed ybot = max(y, fo->pbox->p.y);			
0.3%	0.1%	1632	    fixed ytop = min(y1, fo->pbox->q.y);			
		1633				
0.1%	0.0%	1634	    if (ybot >= ytop)			
		1635		return 0;			
		1636	    vd_quad(le->start.x, ybot, re->start.x, ybot, re->end.x, ytop,
le->end.x, ytop, 1, VD_TRAP_COLOR);			
0.1%	2.3%	1637	    return (*fo->fill_trap)			
		1638		(fo->dev, le, re, ybot, ytop, false, fo->pdevc, fo->lop);			
		1639	}			




------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.



More information about the gs-bugs mailing list