Re: Flexible __autoload scheme

From: Berislav Lopac (berislav.lopac_at_dimedia.hr)
Date: 09/10/04

  • Next message: Alain FONTAINE: "Project, files and directories organisation"
    Date: Fri, 10 Sep 2004 08:34:24 +0200
    
    

    Zurab Davitiani wrote:
    > Berislav Lopac wrote:
    >
    >> A tangential question: does anyone has an idea which would have a
    >> better performance -- iterating through an array as you suggest
    >> above, or finding in an XML file using XPath and SimpleXML, assuming
    >> the same number of nodes?
    >
    > What would be the purpose of an XML file if all you want is a
    > one-dimensional classpath array that's created on the fly? What other
    > properties/attributes would you track? Almost certainly, an XML file
    > would need more memory and create more overhead.

    Because array must be iterated through, while a DOM document can be searched
    via XPath by a simple /*/classname (or something; I must refresh my Xpath
    skills). Of course that XML needs more memory, but I'd like to know
    generally which is faster, iterating arrays or DOM document creation + Xpath
    search. Intuitively I'd also go for the first, but I'm asking if someone has
    any first-hand experience.

    Berislav

    --
    If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
    Groucho, Chico, and Harpo, then Usenet is Zeppo.
    

  • Next message: Alain FONTAINE: "Project, files and directories organisation"

    Relevant Pages

    • Re: How to dynamically resize an array?
      ... In the previous version of the program I just gave the array a large value eg. 40 as it is unlikely any season of a TV series will have that many episodes. ... The only other way would be to read the xml file twice, firstly counting the number of episodes and then declaring the array, and then read it again and fetch in the episode data. ... XPATH is specifically designed to search for the "DOM" of the XML documentt to returns a list of elements by providing it a query statement. ...
      (microsoft.public.dotnet.languages.vb)
    • Beginners-problem with xpath filter and XML
      ... so forgive me if this is a novice question. ... I am planning to use an XML file called SiteSettings.xml to hold ... U use a datalist and a xmldatasource to display the data. ... I need an xpath that displays only the correct data. ...
      (microsoft.public.dotnet.xml)
    • Re: DBIx::XML::DataLoader
      ... of tables that correspond to the structure of the XML file. ... obviously not all columns in the database are keys or indeces. ... have no idea what XPATH is, let alone what to do with it. ...
      (comp.lang.perl.misc)
    • Re: How to dynamically resize an array?
      ... array a large value eg. 40 as it is unlikely any season of a TV series ... will have that many episodes. ... The only other way would be to read the xml file twice, ... Once you load the XML document, use XPATH query statements to find ...
      (microsoft.public.dotnet.languages.vb)
    • Re: getting XPath in REXML to dive deeper
      ... Gavin Kistner wrote: ... I've learned a bit about XPath and how REXML can use it. ... a sample XML file whose root element is. ...
      (comp.lang.ruby)