Performance tip
Brought to you by:
bs_php,
nigelswinson
From: Peter R. <php...@pe...> - 2002-02-22 19:40:15
|
Following on from my posting yesterday re speed of 'evaluate', here's a tip to all users: = avoid all inessential evaluates Given xml structure of many unsorted child nodes which may or may not be present, for example: <topnode> <a/><d/><q/><m/><c/> etc </topnode> and you want the contents of <d> <r> <l> <h> etc Don't do as I originally did and do an evaluate for each of the children. Do an evaluate for all children of <topnode>, then use PHP's array functions to find whether a child exists, then getData for those that exist. This is substantially faster. And if you know a node exists, don't do an evaluate at all - just getData. |