From: Bob Friesenhahn [mailto:bfrie...@simple.dallas.tx.us] Sent: 21. december 2010 03:14
On Mon, 20 Dec 2010, Esben Høgh-Rasmussen wrote: >> In my opinion, TLD (thread local data) is over engineering and not >> generally available. Why not just reserve a small buffer on the stack and >> pass it to a thread-safe version of the conversion routine? > In what way is it not "generally available"? POSIX & Microsoft > Windows seems to cover quite a lot of the world's computing. Surely > over 99%. But LCMS is currently reasonably easy to port to non-hosted environments. I don't even know how to implement TLD efficiently on Windows without compiler specific extensions, but that may obviously be ignorance on my part. >> cmsTransformBuf buf; >> cmsDoTransformTS(src, dst, pix_count, &buf); >> >> The single-pixel would simply be put in the buffer. > This works but of course is a new API and requires that > cmsTransformBuf remain consistent for the ABI. It does seem to offer > ultimate performance. Well, the ABI could just be a bunch of bytes with room to grow. Another option: the pixel cache could be on the stack in cmsDoTransform(). Obviously, the cache would be cleared for a new call, but even if it is called once per line of the bitmap, you should still get most of the speed gain. I think the performance lost with this scheme is outweighed by the advantages of making a transform usable from any number of threads. Perhaps this would be enough to eliminate the need for any locking in LCMS? Regards, Esben H-R Myosotis ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user