[fetter-devel] Verrazano Speedup, take 2

Rayiner Hashem rayiner at gmail.com
Wed Jan 31 21:10:16 UTC 2007


Ok, nice optimization. It shouldn't break anything, so it shouldn't
hurt to incorporate it. Let me know what kind of progress you make
against Qt 4.2. I suspect the vtable layout code is not smart enough
to handle a library that complex (yet).

On a somewhat unrelated note, I've finagled my way into using Lisp and
Cairo to do a software simulation/mockup for a design competition here
at school. This will hopefully generate some improvements in Vzn by
virtue of my having to use it myself for the next few months :)

On 1/27/07, Daniel Herring <dherring at tentpost.com> wrote:
> FWIW, running Verrazano against Qt4.2 (a) isn't working for me and (b) is
> very slow.  Thus, I'm trying to fix (b) to help debug (a).  Profiling
> indicates that most of the time is being spent in (read-macros), hence my
> focus.
>
> >From my read of parser.lisp, (create-macro-nodes) sets the "current file"
> when a line begins with "# ", and (create-macro-node) only processes lines
> beginning with "#define ".
>
> When Verrazano obtains the Qt macros, it calls
> `gccxml --preprocess -dDI -I/opt/qt4.2/include vzntemp.cpp > vzntemp.mac`
> where vzntemp.cpp is simply the two lines
> #include "Qt/QtCore"
> const int __verrazano_binding = 1;
>
> The resulting vzntemp.mac is 1.5MB in size, but only 215KB consists of
> lines starting with "#"; the rest is blank lines or function definitions.
> Examples:
> void qDebug(const char *, ...)
>      __attribute__ ((format (printf, 1, 2)))
> ;
>
> class QString;
>   QString qt_error_string(int errorCode = -1);
>   void qCritical(const char *, ...)
>      __attribute__ ((format (printf, 1, 2)))
> ;
>
>
> Thus, I modified (read-macros) to only store non-empty lines beginning
> with #\# (since the rest are never used).
>
> verrazano/frontend/parser.lisp:74
> ; read macro definitions from the macro file
> (defun read-macros (path)
>    (let ((macs nil))
>      (with-open-file (in path :direction :input :if-exists :supersede)
>        (loop for line = (read-line in nil 'eof)
>             until (eq line 'eof)
>             do (if (and (not (equal "" line)) (eq #\# (char line 0)))
>                     (push-end (split-sequence #\Space line) macs))))
>      macs))
>
>
> This results in fast operation (10s versus 90s), with the added benefit of
> (hopefully) not breaking the macro processing.
>
> Later,
> Daniel
> _______________________________________________
> fetter-devel mailing list
> fetter-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/fetter-devel
>



More information about the fetter-devel mailing list