#2033: Moving g.pnmcomp to lib/display to improve render performance of wxGUI
----------------------------------------------+-----------------------------
 Reporter:  huhabla                           |       Owner:  grass-dev@…       
       
     Type:  enhancement                       |      Status:  new               
       
 Priority:  major                             |   Milestone:  7.0.0             
       
Component:  wxGUI                             |     Version:  svn-trunk         
       
 Keywords:  display, Python, multiprocessing  |    Platform:  All               
       
      Cpu:  All                               |  
----------------------------------------------+-----------------------------

Comment(by glynn):

 Replying to [comment:6 huhabla]:
 > It seems to me that creating raw bmp images without mmap enabled shows
 the best performance for the PNG and Cairo driver. Maybe i did something
 wrong, but the use of mmap shows no obvious benefit?

 Using mmap() in the driver is probably not that significant in this
 context.

 It's more useful when GRASS_PNG_READ=TRUE, the resolution is high, and the
 rendering is simple and/or limited to a portion of the image. In that
 situation, mmap() eliminates the read() as well as the write(), and only
 the modified portion needs to be read and written.

 Another area where it matters is with e.g. wximgview.py (and its
 predecessors), as it's safe to read a BMP image which is being modified
 using mmap(), whereas doing the same thing to a file which is being
 written out with write() runs the risk reading a truncated file.

 Other than that, the performance difference between using mmap() and
 read() on the read side boils down to mmap() avoiding a memcpy(). The
 extent to which that matters depends upon what else you're doing with the
 data. For wxGUI, it's probably a drop in the ocean.

 > Any suggestions to improve the benchmark? Does my setup produce
 reasonable results?

 There isn't anything I'd particularly take issue with. However:

 1. With the cairo driver, BMP files use pre-multiplied alpha (because
 that's what cairo uses internally), whereas PPM/PGM output includes an un-
 multiplication step. So depending upon your perspective, the cairodriver
 benchmarks are rigged against PPM or in favour of BMP.

 2. Producing separate results for PPM with g.pnmcomp and PPM with PIL
 would provide a clearer comparison between the two compositing options and
 the various formats.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2033#comment:7>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to