Re: [Lcms-user] Benefits Of Keeping Profiles Open To Reuse Them
An ICC-based CMM for color management
Brought to you by:
mm2
From: <mar...@li...> - 2020-05-22 12:03:41
|
<div dir='auto'><div>Hi Kevin, </div><div dir="auto"><br></div><div dir="auto">Opening profiles at the begin and then reusing them in different transforms is a good idea. The code is designed to work in that way. There should be no issues on concurrency, as the library does the necessary locks. Just avoid cmsChangeBuffersFormat to modify a yet created transform, this is a throughput killer</div><div dir="auto"><br></div><div dir="auto">Memory fragmentation is not an issue, the code uses sub-allocators. Keep you focus on code clarity, there is no need of dummy transforms.</div><div dir="auto"><br></div><div dir="auto">Regards</div><div dir="auto">Marti</div><div dir="auto"><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On 22 May 2020 13:32, Kev via Lcms-user <lcm...@li...> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:'helvetica neue' , 'helvetica' , 'arial' , sans-serif;font-size:13px"><div dir="ltr">Hi.</div><div dir="ltr"><br></div><div dir="ltr">Our lcms2 usage is quite basic: <br></div><div dir="ltr">open source & target profiles held in memory > create transform > do transform > delete transform > close both profiles</div><div dir="ltr"><br></div><div dir="ltr">(our code originally used lcms1 so when we switched to lcms2 we kept the changes to a minimum).</div><div dir="ltr"><br></div><div dir="ltr">Quite often, the target profile will be the same sRGB profile and sometimes the source profile will be a generic CMYK profile.</div><div dir="ltr"><br></div><div dir="ltr">I guess there is an overhead of always opening and closing these common profiles so i'm wondering if it would be better to create them at startup and leave them open until our application closes. If we did change our code is there any issues we need to look out for. For example,<br></div><div dir="ltr">• Would there be any multi-threading related issues caused by different transforms using the same profiles at the same time?</div><div dir="ltr"><br></div><div dir="ltr">• I'm sure I read that opening a profile only reads a subset of the data and the rest isn't read until it is required. I guess this could cause memory fragmentation issues so to help avoid this would it be a good idea to perform a dummy transform after opening the profile so that the rest of the profile data was read into memory as early as possible.<br></div><div dir="ltr"><br></div><div><br></div><div dir="ltr">Any help or advice would be greatly appreciated.<br></div><div><br></div><div><br></div><div dir="ltr">Regards,<br>Kevin<br></div></div></div></blockquote></div><br></div></div></div> |