-->

How to benchmark single TypoSript Object generatio

2019-05-11 00:52发布

问题:

I would like to benchmark single TypoScript object generation to control the performance, is it possible, probably, with some stdWrap methods ?

Example of TS objects, which I would like to benchmark :

Test 1

  page.10 = RECORDS
    page.10 {
        tables = pages
        source = 1
        dontCheckPid  = 1
        conf.pages = TEXT
        conf.pages.field = title
    }

Test 2

page.20 = CONTENT
page.20 {
   table = tt_content
   select {
       pidInList = 0
       recursive = 99
       where = uid = 1
   }
}

I need each object generation time and quantity of fired queries.

回答1:

I guess it could be done via Extension. I guess there is a possibility to hook in (or xclass) the Database Layer (like DBAL does). In your extension you could then just test the different TypoScript setups via $this->cObj->cObjGetSingle($this->conf['test1'],$this->conf['test1.'],'test1');

Perhaps have a look at t3lib_timeTrack, may be it is enough what is tracked there. But AFAIK everything which is tracked is available via Admin-Panel (check all checkboxes).