Re: [Tuxpaint-dev] Tinting in CVS
On Fri, Nov 26, 2004 at 07:21:17PM -0500, Albert Cahalan wrote: > First of all, the butterfly is looking better than ever > for me. It tints perfectly. I'll send you an example. *blush* I was NOT using the latest tuxpaint-stamps from CVS, sorry. :^( I had updated everything on my wife's laptop, but not on my desktop. What a goof. I have an excuse, though... I've been under the weather lately. :^P > I'd have expected your PC to be very fast at this, because > the PC has built-in trancedental math functions in the CPU. > You have instructions for sin(), cos(), tan(), and so on. > > Unlikely to be the problem, but... > > One thing that may need to change for a PC is the place where > a double is compared against zero. Instead of this: > > if(dst.sat>0) > > You might be better off with: > > if(dst.sat>0.0001) I can give it a try. Thanks -bill! ___ Tuxpaint-dev mailing list [EMAIL PROTECTED] http://tux4kids.net/mailman/listinfo/tuxpaint-dev
Re: [Tuxpaint-dev] Tinting in CVS
On Fri, 2004-11-26 at 21:23, Mark K. Kim wrote: > On Fri, 26 Nov 2004, Albert Cahalan wrote: > > > One thing that may need to change for a PC is the place where > > a double is compared against zero. Instead of this: > > > > if(dst.sat>0) > > > > You might be better off with: > > > > if(dst.sat>0.0001) > > How does that offer performance increase??? Generally, it doesn't. It's a matter of accuracy in being able to determine if the destination color is greyscale. This is just a possible bug that popped into my head while thinking about the code, nothing more. (a Mac handles this well, but a PC has a variable number of fraction bits because of the truncation that occurs when an 80-bit float is spilled to a 64-bit stack location) There could be a place where something like the above would send the code around for a loop though. ___ Tuxpaint-dev mailing list [EMAIL PROTECTED] http://tux4kids.net/mailman/listinfo/tuxpaint-dev
Re: [Tuxpaint-dev] Tinting in CVS
On Fri, 26 Nov 2004, Albert Cahalan wrote: > Windows profiler output might be helpful too. Surely there > are some suitable tools... maybe Intel provides some? I think Visual C/C++ comes with a profiler. Haven't we been able to compile Tux Paint using both MinGW and VC? If that's the case, we could use VC's profiler, if someone with VC could volunteer! -Mark (*not* a VC user) -- Mark K. Kim AIM: markus kimius Homepage: http://www.cbreak.org/ Xanga: http://www.xanga.com/vindaci Friendster: http://www.friendster.com/user.php?uid=13046 PGP key fingerprint: 7324 BACA 53AD E504 A76E 5167 6822 94F0 F298 5DCE PGP key available on the homepage ___ Tuxpaint-dev mailing list [EMAIL PROTECTED] http://tux4kids.net/mailman/listinfo/tuxpaint-dev
Re: [Tuxpaint-dev] Tinting in CVS
On Fri, 26 Nov 2004, Albert Cahalan wrote: > One thing that may need to change for a PC is the place where > a double is compared against zero. Instead of this: > > if(dst.sat>0) > > You might be better off with: > > if(dst.sat>0.0001) How does that offer performance increase??? -Mark -- Mark K. Kim AIM: markus kimius Homepage: http://www.cbreak.org/ Xanga: http://www.xanga.com/vindaci Friendster: http://www.friendster.com/user.php?uid=13046 PGP key fingerprint: 7324 BACA 53AD E504 A76E 5167 6822 94F0 F298 5DCE PGP key available on the homepage ___ Tuxpaint-dev mailing list [EMAIL PROTECTED] http://tux4kids.net/mailman/listinfo/tuxpaint-dev
Re: [Tuxpaint-dev] Tinting in CVS
This may have something to do with the performance: gcc-3.4 (GCC) 3.4.2 (Debian 3.4.2-3) This compiler does alias analysis and whole-file optimization. If that does the job for you, then don't worry. Most users will be getting binaries compiled with gcc 3.4 or later. For the Windows build, ensure that the fast math options are enabled. (using the x86 transcedental math instructions) If alias analysis is an option, enable that too. There are plenty of opportunities for hand-optimizing the code if compiler adjustments don't do the job. I didn't bother, because a bone-headed implementation was easier to develop and plenty fast on my system. Some ideas are: a. reduce the size of the multichan struct b. re-use original sRGB data for unmodified pixels c. use a look-up table for sRGB to L,u,v d. [painful and inaccurate] interpolate for L,u,v to sRGB It would be great if you could run a line-by-line profiler on the code to see where the time is going. Try using oprofile and kcachegrind to find where cache misses happen. (this is where the --playback option would be great) Windows profiler output might be helpful too. Surely there are some suitable tools... maybe Intel provides some? ___ Tuxpaint-dev mailing list [EMAIL PROTECTED] http://tux4kids.net/mailman/listinfo/tuxpaint-dev
Re: [Tuxpaint-dev] Tinting in CVS
On Fri, 2004-11-26 at 18:54, Bill Kendrick wrote: > Tinting in CVS is a bit broken right now, and VERY slow (on my 450MHz Celeron, > at least). > > Best example is the cartoon butterfly. It doesn't change color (it's always > orange), and takes about 2 seconds between my clicking, and it appearing > on the canvas. > > Ideas? :) > > (This is with the latest CVS for both stamps and code) First of all, the butterfly is looking better than ever for me. It tints perfectly. I'll send you an example. I'd have expected your PC to be very fast at this, because the PC has built-in trancedental math functions in the CPU. You have instructions for sin(), cos(), tan(), and so on. Unlikely to be the problem, but... One thing that may need to change for a PC is the place where a double is compared against zero. Instead of this: if(dst.sat>0) You might be better off with: if(dst.sat>0.0001) ___ Tuxpaint-dev mailing list [EMAIL PROTECTED] http://tux4kids.net/mailman/listinfo/tuxpaint-dev