Help :\ Custom Module that search a big XML file

Author Message

H-Works Agency

Sunday 24 September 2006 9:40:13 am

Hi all,

I am making a custom module that use ajax to return results from a big XML file to the module form.

I can read the whole XML documents into an array then filter it using php but this method is very very slow.

Should i use <b>phpXpath</b> or <b>ezxml.php</b> lib to search through my XML file ?

What is the best way to handle this case ?

Thanx for the help in advance,
Martin Harispuru

EZP is Great

Xavier Dutoit

Saturday 30 September 2006 2:18:07 am

Hi,

When I had really big files, I found that SAX performed better than DOM.

Have a look at the php functions.
http:/www.php.net/domxml
http://www.php.net/manual/en/ref.xml.php

The closer to these function, the faster it's going to be, but that's likely to be longer to dev.

Depends of what you want to do in detail, of course.

Good luck.

X+

http://www.sydesy.com

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 04:44:47
Script start
Timing: Jan 19 2025 04:44:47
Module start 'layout'
Timing: Jan 19 2025 04:44:47
Module start 'content'
Timing: Jan 19 2025 04:44:48
Module end 'content'
Timing: Jan 19 2025 04:44:48
Script end

Main resources:

Total runtime0.7773 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 589.2891152.6406
Module start 'layout' 0.00540.0025 741.929739.4766
Module start 'content' 0.00780.7678 781.4063528.6328
Module end 'content' 0.77560.0016 1,310.03918.1250
Script end 0.7772  1,318.1641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4084160.0002
Check MTime0.00130.1664160.0001
Mysql Total
Database connection0.00060.075910.0006
Mysqli_queries0.728693.7333540.0135
Looping result0.00050.0637520.0000
Template Total0.748196.220.3741
Template load0.00210.267020.0010
Template processing0.746095.977620.3730
Template load and register function0.00010.010810.0001
states
state_id_array0.00080.105210.0008
state_identifier_array0.00100.126120.0005
Override
Cache load0.00170.2165220.0001
Sytem overhead
Fetch class attribute can translate value0.00060.079520.0003
Fetch class attribute name0.00100.132240.0003
XML
Image XML parsing0.00100.131920.0005
class_abstraction
Instantiating content class attribute0.00000.001140.0000
General
dbfile0.00160.2033230.0001
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs