Menu

HereIsEasy way to greatly improve performance

Help
2005-01-20
2013-03-14
  • Nobody/Anonymous

    In the php coding of RAP, some of the function of a class may 'include_once' another php document, which will badly reduce the performance of the RAP.

    I find it (just an example, may happen somewhere else) in the Resource class.
    The getLocalName() and getNamespace() will include/run the whole package_utility (RdfUtil.php & FindIterator.php) script every time the function is called.
    It greatly reduce the performance of Model::writeAsHtml() function.

    The simple method is NEVER include any other php script file in a function (especially usually called), but place the include on the top of the script instead.
    (e.g. for Resource class , I placed the include_once "..." before the declaration of the class, that's is top of the script)

    I've record the running time of the writeAsHtml before and after modify.
    my system : apache + php + mysql , cpu Althon 1800Mhz
    Before modify the Resource class :
    For an about 40 statement model, it take me average 0.13 second.
    After modify :
    it take average 0.04 second only.

     
    • Tobias Gauß

      Tobias Gauß - 2005-01-21

      Hi,
      thanks this suggestion. You are right that it's better to include the package at the top of the script. We will implement this in our next release.

      Thanks for Your efforts,
      Tobias Gauss

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.