Opened 16 years ago

Closed 16 years ago

#2615 closed defect (fixed)

Call curl_global_init() only when really required

Reported by: dmorissette Owned by: dmorissette
Priority: normal Milestone: 5.2 release
Component: WMS Client Version: unspecified
Severity: normal Keywords:
Cc: pramsey

Description

Paul Ramsey found and reported the following performance issue on the --dev list:

Another thing Shark tells me is that we are burning resources in curl_global_init (called from msHTTPInit via msHTTPInitRequestObj) even when there are no WMS or WFS layers defined. This is eating about 5% of the total cycles, on a fairly well-tuned map file, and could be fixed.

Change History (4)

comment:1 by dmorissette, 16 years ago

Status: newassigned

comment:2 by dmorissette, 16 years ago

The fix for this is trivial: move the msHTTPInit() call from msHTTPInitRequestObj() to msHTTPExecuteRequests() since that's the only place where curl calls are made.

I've made that change in r7582.

There is also room for another optimization in msDrawMap() (mapdraw.c) where we should call msHTTPInitRequestObj() only *if* there are WMS/WFS layers to draw. Checking that now.

comment:3 by pramsey, 16 years ago

Optimization two is probably not worth your time. The init stuff has disappeared from the trace of noticeable function calls now that you've moved the curl init.

comment:4 by dmorissette, 16 years ago

Resolution: fixed
Status: assignedclosed

Too late, I was already almost done rearranging things in msDrawMap() when I read your comment, and it really bugged me to see an allocation of numLayers * HTTPRequestObjs all the time even when there are no WMS/WFS layers to download, which is 99% of the time.

Committed to trunk in r7583.

Fixed.

Note: See TracTickets for help on using tickets.