<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div><br></div><div>Hey,</div><div><br></div><div>I am also quite interested in your code and the stuff you've written about, could provide links to both?</div><div><br></div><div>About the array code, a good place to start is in pd/src/g_array.c.  Take a look there, and feel free to post any questions on this list so we can answer them.</div><div><br></div><div>.hc</div><br><div><html>On Apr 13, 2008, at 11:54 AM, Jakob Leben wrote:</html><br class="Apple-interchange-newline"><blockquote type="cite">Hello to all the PD developers!<br><br>As the word goes about improving pd's GUI speed, I thought this is the perfect opportunity for me to share some ideas, that I've already written about on the <a href="http://puredata.info">puredata.info</a> homepage.<br> <br>Let me introduce myself first. My name is Jakob Leben, I'm from Slovenia and I'm actively using pure data. I can say I have quite some experience with writing pd externals, but I don't have an integral insight into pd's source code.<br> <br>Lately I made an external that visualizes pd's graphic arrays but much faster than pd natively does. (If I load 20 seconds of audio into a pd's array the drawing of the array causes clicks in audio. Another big problem is dragging a graphic array around the patch, that works extra slow.<br> <br>There are two things one could do:<br>1. change the algorithm for visualisation of array's data.<br>2. draw the data onto a specially loaded Tk canvas, so that when dragging the array around only the canvas' window is translated instead of all the coordinates for the line that represents data.<br> <br>Detailed explanation:<br>1. When the width of array's visualisation in pixels is smaller than the number of samples written into array it's useless to draw a segment of the line for each sample of data. Instead you can only draw one vertical segment of line for each column of pixels drawn: this segment's endpoints are defined by the minimum and the maximum value of the range of data that is "covered" by this pixel.<br> The result of this is exactly the same as the way arrays are drawn now, though it involves much less line segments being drawn.<br>2. There is one problem that I came across with using a special canvas to visualise an array: a click on that canvas doesn't select the pd object that lies "under" this canvas. This canvas will always be "above" the object as all the objects are only items of one single Tk canvas, while this new canvas is the general canvas' child displayed as a general canvas' item of type window. Tk rule is that items of type window are always "above" all other items on a canvas.<br> Thus it would be necessary to make a new binding for mouse events to this new canvas and somehow pass that click to pd's object.<br><br>Now, I realized these ideas in the form of a pd extern that visualises an array, but i think it would be great to integrate those ideas into pd's arrays itself. I could do that if only I understood better how PD's arrays are drawn and how the selection of pd's object works... I tried but it seems to my like too big a project to dig out myself where in the code and how those things happen so I would appreciate very much if someone guided me through this.<br> <br>I'm willing to put all my effort into making those arrays draw faster.<br><br>Sincerely,<br>Jakob Leben<br><br><div class="gmail_quote">On Sat, Apr 12, 2008 at 9:01 PM, Hans-Christoph Steiner &lt;<a href="mailto:hans@eds.org">hans@eds.org</a>> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br> It seems there is a profiler for Tcl.  Has anyone ever tried it on Pd?<br> <br> Begin forwarded message:<br> > From: Revar Desmera &lt;<a href="mailto:revarbat@gmail.com">revarbat@gmail.com</a>><br> > Date: April 9, 2008 10:58:55 PM EDT<br> > To: TCL-Mac List &lt;<a href="mailto:tcl-mac@lists.sourceforge.net">tcl-mac@lists.sourceforge.net</a>><br> > Subject: Re: [MACTCL] Improving Application GUI Speed<br> > Delivered-To: <a href="mailto:hans@eds.org">hans@eds.org</a><br> > X-Mailer: Apple Mail (2.919.2)<br> > X-Filter-Rule: ALL_LISTS<br> ><br> > If you download <a href="http://www.belfry.com/code/profile.tcl" target="_blank">http://www.belfry.com/code/profile.tcl</a>, and add a<br> > 'source profile.tcl' to the beginning of your program, when the<br> > program finishes, it'll dump a very detailed timing profile of your<br> > code to tclprof.txt, which you can use to determine what to optimize.<br> > The report format is very close to that of gprof.<br> ><br> >       - Revar<br> ><br> ><br> ><br> > On Apr 8, 2008, at 1:10 AM, Randolf Schultz wrote:<br> >> Hello,<br> >><br> >> please help me getting my application up to speed on MacOSX/Aqua.<br> >> It runs fine on Linux/X11, Win32, and even MacOSX/X11. Only on<br> >> MacOSX/Aqua it crawls.<br> >><br> >> Want to have a look first?<br> >> Go to<br> >><br> >> <a href="http://sourceforge.net/project/platformdownload.php" target="_blank">http://sourceforge.net/project/platformdownload.php</a>?<br> >> group_id=28460&amp;sel_platform=4542<br> >><br> >> (or <a href="http://www.ayam3d.org/download.html" target="_blank">http://www.ayam3d.org/download.html</a>)<br> >><br> >> get both variants (MacOSX/X11 and MacOSX/Aqua).<br> >><br> >> Already the application startup is 2-3s (Linux/X11) vs. 10-15s<br> >> (MacOSX/Aqua); from then on the MacOSX version is unusably<br> >> slow, especially when drawing the scrollable GUIs for the object<br> >> properties (those are implemented as window in a canvas).<br> >> Another problem area are the pane widgets, that may be dragged<br> >> quite fine on X11, but on Aqua they do one hop every 1-2s (and<br> >> this is _without_ continuous re-packing the GUI, only dragging<br> >> the pane handle, which is a simple packed frame IIRC!).<br> >><br> >> The Linux/X11 and MacOSX/Aqua variants were test-run on the<br> >> very same machine (MacMini-PPC)!<br> >><br> >> So how would you proceed to tackle this problem?<br> >> Is there an easy way to profile such complex scenarios with Tcl/Tk?<br> >><br> >> best regards,<br> >> Randolf<br> >><br> >> ---------------------------------------------------------------------<br> >> ----<br> >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference<br> >> Register now and save $200. Hurry, offer ends at 11:59 p.m.,<br> >> Monday, April 7! Use priority code J8TLD2.<br> >> <a href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://" target="_blank">http://ad.doubleclick.net/clk;198757673;13503038;p?http://</a><br> >> <a href="http://java.sun.com/javaone" target="_blank">java.sun.com/javaone</a><br> >> _______________________________________________<br> >> Tcl-mac mailing list<br> >> <a href="mailto:tcl-mac@lists.sourceforge.net">tcl-mac@lists.sourceforge.net</a><br> >> <a href="https://lists.sourceforge.net/lists/listinfo/tcl-mac" target="_blank">https://lists.sourceforge.net/lists/listinfo/tcl-mac</a><br> ><br> ><br> > ----------------------------------------------------------------------<br> > ---<br> > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference<br> > Don't miss this year's exciting event. There's still time to save<br> > $100.<br> > Use priority code J8TL2D2.<br> > <a href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://" target="_blank">http://ad.doubleclick.net/clk;198757673;13503038;p?http://</a><br> > <a href="http://java.sun.com/javaone" target="_blank">java.sun.com/javaone</a><br> > _______________________________________________<br> > Tcl-mac mailing list<br> > <a href="mailto:tcl-mac@lists.sourceforge.net">tcl-mac@lists.sourceforge.net</a><br> > <a href="https://lists.sourceforge.net/lists/listinfo/tcl-mac" target="_blank">https://lists.sourceforge.net/lists/listinfo/tcl-mac</a><br> <br> <br> <br> ------------------------------------------------------------------------<br> ----<br> <br> Using ReBirth is like trying to play an 808 with a long stick.    -<br> David Zicarelli<br> <br> <br> <br> _______________________________________________<br> PD-dev mailing list<br> <a href="mailto:PD-dev@iem.at">PD-dev@iem.at</a><br> <a href="http://lists.puredata.info/listinfo/pd-dev" target="_blank">http://lists.puredata.info/listinfo/pd-dev</a><br> </blockquote></div><br></blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><br class="Apple-interchange-newline"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><br></div><div>----------------------------------------------------------------------------</div><div><br></div><div>Using ReBirth is like trying to play an 808 with a long stick.    -David Zicarelli</div><br class="Apple-interchange-newline"></span></span> </div><br></body></html>