Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Speed up Graph generation
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Speed up Graph generation
 Login/Join
 
Member
posted
I am having a performance issue in generating some graphs for a PDF document. 2 graphs are generated per employee, and in some situations there can be over 800 employees. I'm looping through each employee and holding the svg files based on a counter. I was wondering if anyone could tell if there is a way to speed up this process. Sometimes it's taking over 4 mins to create all of these graphs:

  
-SET &empl_count = &LINES;

-*****Create Graphs for each employee*********************
-SET &graph_int = 1;
-REPEAT :CREATE_GRAPHS &empl_count TIMES;
ENGINE INT CACHE SET ON
GRAPH FILE RAW_DATA
SUM
EMP_PERC AS 'Company Contribution'
EE_PERC AS 'My Contribution'
BY _NAMEPERID NOPRINT
BY _NAMEPERID
WHERE COUNTER EQ &graph_int
ON GRAPH HOLD AS TCS_GRAPH1&graph_int FORMAT SVG
ON GRAPH SET 3D OFF
ON GRAPH SET GRWIDTH 0
ON GRAPH SET UNITS 'INCHES'
ON GRAPH SET HAXIS 3
ON GRAPH SET VAXIS 2
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPlace(true);
*END
INCLUDE=endeflt.sty,$
TYPE=REPORT, TITLETEXT='WebFOCUS Report', $
*GRAPH_SCRIPT
setLegendMarkerPosition(4);
setMarkerDisplay(true);
setSeriesType(0,1);
setSeriesType(1,1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setDisplay(getO1Label(),false);
setDisplay(getY1Label(),false);
setDisplay(getDataText(),true);
setTextFormatPreset(getDataText(),29);
setFontStyle(getTitle(),0);
setTextString(getO1Title(),"");
setDisplay(getBeveledRiser(),false);
setPlaceAlign(getTitle(),1);
setFontSizeAbsolute(getTitle(),true);
setFontSizeInPoints(getTitle(),10);
setPlaceResize(getTitle(),0);
setDisplay(getTitle(),true);
setTransparentBorderColor(getLegendArea(),true);
setLegendMarkersPerRow(0);
setLegendSeriesCount(0);
setFillType(getChartBackground(),1);
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),7);
setPlaceResize(getLegendText(),0);
setRiserWidth(65);
setRiserBarGroupSpacing(20);
setFontSizeAbsolute(getDataText(),true);
setPlaceResize(getDataText(),0);
setTextRotation(getDataText(),0);
setDisplay(getBeveledLegend(),false);
setTransparentBorderColor(getSeries(0),false);
setTransparentBorderColor(getSeries(1),false);
setSeriesType(getSeries(0),1);
setCustomDataText(getDataText(0),false);
setLegendOrient(2);
setDisplay(getO1Label(),false);
setDisplay(getDataText(),true);
setFontName(getDataText(),"Arial");
setFillColor(getDataText(),new Color(0,0,0));
setBorderColor(getFrame(),new Color(255,255,255));
setTransparentFillColor(getLegendArea(),false);
setLegendAutomatic(true);
setTransparentBorderColor(getLegendArea(),true);
setDisplay(getBeveledLegend(),false);
setFillColor(getLegendArea(),new Color(255,255,255,255));
setLegendMarkerPosition(0);
setMarkerShape(getLegendLabelMarker(0),10);
setDisplay(getY1MajorGrid(),false);
setTransparentBorderColor(getChartBackground(),false);
setBorderColor(getChartBackground(),new Color(255,255,255));
setDisplay(getO1MajorGrid(),false);
setAltFmtFrameNumColors(getO1AltFmtFrame(),5);
setDisplay(getO1AltFmtFrame(),false);
setDisplay(getO1MajorGridColorBand1(),false);
setFillColor(getFrame(),new Color(255,210,27));
setTransparentFillColor(getFrame(),true);
setFillColor(getChartBackground(),new Color(255,255,255));
setTransparentFillColor(getFrameSide(),false);
setTransparentBorderColor(getFrameSide(),false);
setBorderColor(getFrameSide(),new Color(255,255,255));
setTransparentFillColor(getFrameBottom(),false);
setTransparentBorderColor(getFrameBottom(),false);
setBorderColor(getFrameBottom(),new Color(255,255,255));
setDisplay(getY1AxisLine(),false);
setDisplay(getO1AxisLine(),false);
setFillColor(getSeries(0),new Color(132,189,0));
setFillColor(getSeries(1),new Color(242,169,0));
setDataTextPosition(1);
setDisplay(getLegendArea(),true);
setLineStyleLegendMarkers(1);
setSquareMarkers(true);
setUseSeriesShapes(true);
setMarkerShape(getSeries(0),1);
setMarkerShape(getSeries(1),1);
setNullLegendMarkerShapesAsSquares(false);
setLegendPosition(1);
setFontStyle(getDataText(),0);
setFontSizeInPoints(getDataText(),9);
setUseOffScreen(false);
*END
ENDSTYLE
END

-*****PULL DATA FOR GRAPH 2*****
MATCH FILE RAW_DATA
BY PERSON_ID
WHERE COUNTER EQ &graph_int
RUN

FILE PAYROLL_DATA
SUM
DPAY_PAY_AMT
BY DPAY_PER_ID AS PERSON_ID
BY SUMGRP_TITLE
AFTER MATCH HOLD AS GRAPH2_DATA OLD
END
-RUN

ENGINE INT CACHE SET ON
GRAPH FILE GRAPH2_DATA
SUM
DPAY_PAY_AMT
BY PERSON_ID NOPRINT
BY TOTAL HIGHEST DPAY_PAY_AMT NOPRINT
BY SUMGRP_TITLE
WHERE DPAY_PAY_AMT NE 0;
ON GRAPH HOLD AS TCS_GRAPH2&graph_int FORMAT SVG
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET HAXIS 3.0
ON GRAPH SET VAXIS 2.0
ON GRAPH SET UNITS INCHES
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 1
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPlace(true);
setPieFeelerTextDisplay(1);
*END
INCLUDE=endeflt.sty,$
TYPE=REPORT, TITLETEXT='WebFOCUS Report', $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setLegendPosition(2);
setDisplay(getPieLabel(),false);
setPieFeelerTextDisplay(0);
setFontName(getLegendText(),"ARIAL");
setFontSizeAbsolute(getLegendText(),true);
setAutofit(getLegendText(),false);
setFontSizeInPoints(getLegendText(),6);
setPlaceResize(getLegendText(),0);
setFillColor(getSeries(0),new Color(#81C341));
setFillColor(getSeries(1),new Color(#00ABEB));
setFillColor(getSeries(2),new Color(#F27430));
setFillColor(getSeries(3),new Color(#FDB414));
setFillColor(getSeries(4),new Color(#970E76));
setFillColor(getSeries(5),new Color(#53565F));
setFillColor(getSeries(6),new Color(#E1DDCC));
setFillColor(getSeries(7),new Color(203,182,119));
setPieRotate(90);
setLegendPosition(2);
setLegendOrient(0);
setUseOffScreen(false);
*GRAPH_JS
"riserBevel": "none",
*END
ENDSTYLE
END

-SET &graph_int = &graph_int + 1;
-:CREATE_GRAPHS

This message has been edited. Last edited by: FP Mod Chuck,


WF version 8105
all output
 
Posts: 22 | Registered: February 17, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
If you have 800 iterations of this then the first thing that I would look at is the MATCH you have contained within your process. This is going off to the PAYROLL_DATA everytime for the number of employees.

See if you can pull all the data in a single pass and then only process the post accumulated / aggregated data once rather than 800 odd times. Much better to handle the data once rather than 800 times!


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5606 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Member
posted Hide Post
Ok, I removed the match altogether from the loop. It didn't increase performance much (like 2 seconds) since both were HOLD files in memory and not pulling from a DB.

Can you see any settings that could be removed from the graph generation part that might be causing it to slow down?


WF version 8105
all output
 
Posts: 22 | Registered: February 17, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
Ok, look at the actual elapsed time to render the SVGs separate to the inclusion within the PDF - to determine whether the build of the PDF is where your processing delay exists.

Change the label lines to include the following code so that you can see what each SVG actually is timed at.

-SET &Suff = FPRINT(&graph_int.EVAL, 'I6L', 'A6');
-SET &TIME_&Suff.EVAL = HHMMSS('A8');

-SET &graph_int = &graph_int + 1;
-:CREATE_GRAPHS

-? &TIME


If you add a similar &TIME variable to after your PDF (send to HOLD instead of PCHOLD), you can see how long the PDF takes to render.

If the PDF is taking the time, then try changing the SVG to PNG or something else that can be included within your PDF, so that you can see if using another format could give you an increase in speed.

Of course, the alternative image format might not give you the definition of an SVG but that is something you need to take into account and explain to your report recipient(s) if this is executed interactively.

If you only run it occasionally, then consider running via Report Caster and send the output. The time taken then is potentially less of a concern.

If your users run this interactively (hit a button and wait for the results) then ask
  • whether they need all reports
  • whether they need the report immediately


If the answer to the first item is yes, then consider parameterising your report(s).

If the answer to the second item is yes, then consider running the report in deferred mode.

Many potential areas that might provide an improvement, you just have to break down your processing to understand what is time intensive (also consider using Resource Analyser). Consider what data you are handling and how repetitive that might be, also how you might reduce the number of times you handle the same data.

As suggested above, the quality of the image (via a specific format) might extend the processing time, so consider other formats.

Really, this is something that only you can do, because you have the entire data and can take the time to test individual sections of your process.

Finally, a solution might be possible if you engage your local Professional services team via some consultancy. True, this will cost your company for the time, but consider how much time you might recoup via their experience and knowledge over how long it might take you to achieve the same!

Good luck!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5606 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Speed up Graph generation

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.