27 March 2011

From Organic Design wiki
Warning.svg This is a blog item that needs to be converted to the new Bliki format


RecordAdmin performance improved

One of our clients has some complex record tables which became extremely slow when there were more than 100 rows of data in the resultant set. After analysing the execution of the slow queries it turned out that over 90% of the processing time was in the renderRecords method. The problem was that the initialisation of the wiki parser takes a lot of resource, and it was being initialised once for every cell of data in the table. The problem was fixed (see diff) by breaking the render loop out into two passes, the first to build a single block of wikitext for the whole table with delimiters for columns and rows, and the second to render the table drawing from the pre-parsed cell data rather than calling the wiki parser directly. This has resulted in a massive performance improvement in record table rendering, large tables having more than a hundred rows can now render over fifty times faster!