Opened 12 years ago

Last modified 12 years ago

#4235 new defect

make shapeObj leaner — at Version 2

Reported by: tbonfort Owned by: sdlime
Priority: low Milestone: FUTURE
Component: MapServer C Library Version: svn-trunk (development)
Severity: normal Keywords:
Cc: sdlime, dmorissette, aboudreault

Description (last modified by tbonfort)

The shapeObj structure is used in multiple places as a placeholder for geometries only, it's other members (values, tileindex, etc... ) being unnecessary.

In the labelcache and rendering phase these shapeObjs are copied around and allocated, and we might gain a bit of performance and memory allocations if these places in the code used a leaner object for storing geometries.

We could rename the actual shapeObj to featureObj, and use a trimmed down version of shapeObj where only the actual geometry is used. Example structs could be:

struct {
  lineObj *line;
  int nlines;
  int type;
  rectObj bounds;
} shapeObj;

struct {
  shapeObj shape;
  char *text;
  int layerindex;
  /* ... etc ... all values from current shapeObj */
} featureObj;

Change History (2)

comment:1 by tbonfort, 12 years ago

Cc: dmorissette added

Not sure what the backwards incompatibility will be in mapscript. Daniel, are shapeObjs exposed to mapscript and used extensively?

comment:2 by tbonfort, 12 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.