<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.rws.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Optimize integration for speed</title><link>https://community.rws.com/product-groups/linguistic-ai/cloud/w/language-weaver-wiki/5229/optimize-integration-for-speed</link><description>Wiki for Language Weaver Cloud</description><dc:language>en-US</dc:language><generator>Telligent Community 12 Non-Production</generator><item><title>Optimize integration for speed</title><link>https://community.rws.com/product-groups/linguistic-ai/cloud/w/language-weaver-wiki/5229/optimize-integration-for-speed</link><pubDate>Wed, 22 Apr 2020 21:16:52 GMT</pubDate><guid isPermaLink="false">10acfa76-f078-475b-a7ef-fc5b3e8d2934:0c26f191-c8b2-41a3-89e8-08d54fb20eb5</guid><dc:creator>Quinn Lam (former member)</dc:creator><comments>https://community.rws.com/product-groups/linguistic-ai/cloud/w/language-weaver-wiki/5229/optimize-integration-for-speed#comments</comments><description>Current Revision posted to Wiki by Quinn Lam (former member) on 4/22/2020 9:16:52 PM&lt;br /&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;There are various approaches you can&amp;nbsp;leverage to optimize your integration with SDL Machine Translation Cloud for speed.&amp;nbsp; Each are described in more details below.&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;Use&amp;nbsp;&lt;strong&gt;Keep-Alive&lt;/strong&gt; connection&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;Store and &lt;strong&gt;reuse authentication token&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;Use the&amp;nbsp;&lt;strong&gt;translationMode&lt;/strong&gt; parameter to express preference for Speed&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;Use &lt;strong&gt;synchronous translation endpoint&lt;/strong&gt; for input under 1,000 characters&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:200%;"&gt;Use Keep-Alive&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;One of the most simple thing that you can do to improve your workflow with SDL Machine Translation Cloud is to use Keep-Alive in your calls.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;HTTP keep-alive, a.k.a., HTTP persistent connection, is an instruction that allows a single TCP connection to remain open for multiple HTTP requests/responses.&amp;quot;&lt;sup&gt;1&lt;/sup&gt;&amp;nbsp;- &lt;a href="https://www.imperva.com/learn/performance/http-keep-alive/"&gt;Imperva&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Want to&amp;nbsp;quantify how this can actually help your integration?&amp;nbsp; Try the following.&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;Create a new file called &amp;quot;connection-test.txt&amp;quot; and paste in this:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;    time_namelookup:  %{time_namelookup}\n
       time_connect:  %{time_connect}\n
    time_appconnect:  %{time_appconnect}\n
   time_pretransfer:  %{time_pretransfer}\n
      time_redirect:  %{time_redirect}\n
 time_starttransfer:  %{time_starttransfer}\n
                    ----------\n
         time_total:  %{time_total}\n&lt;/code&gt;&lt;/pre&gt;
&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;Make a request to SDL MT Cloud REST API server (update the request sample below with your own credentials)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;curl -w &amp;quot;@connection-test.txt&amp;quot; -XPOST -H &amp;quot;Content-type: application/json&amp;quot; \&lt;br /&gt;-d &amp;#39;{&amp;quot;clientId&amp;quot;: &amp;quot;&lt;span style="color:#808080;"&gt;F0ZUe28HFE8eaMLRLGJrIK0M6WGI9Nu&lt;/span&gt;&amp;quot;, &amp;quot;clientSecret&amp;quot;: &amp;quot;&lt;span style="color:#808080;"&gt;HFE8etNdtUP1liTrIKCtvlbGZ8Bv6Sxb-TAO_etNdHEcbWGu0KPGkVIu4QjiNEBt&lt;/span&gt;&amp;quot;}&amp;#39; \&lt;br /&gt;&amp;quot;&lt;/code&gt;&lt;code&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//translate-api.sdlbeglobal.com/v4/token&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;span&gt;Repeat step 2&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&amp;nbsp;Because curl has keep-alive on as a default, you can compare the &amp;quot;time_connect&amp;quot; between the response for #2 and #3.&amp;nbsp; The difference between these two values is&amp;nbsp;approximately the time your program will save by making requests with keep-alive option enabled.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;While at first glance, the time save may seem very minimal, but it is significant for any integrations that do many translation requests and polls per minute.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:200%;"&gt;Store and reuse authentication tokens&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;All requests to the SDL MT Cloud REST API requires a valid authentication token.&amp;nbsp; We recommend to request&amp;nbsp;a token once and store it, then only request a new one when the token expires. This way you will get the best performance possible, as your application will not make an extra request for every translation call (this extra request will add up after a while if the application has high translation needs).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:200%;"&gt;Declare translationMode preference for Speed&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;There is an optional parameter for the &lt;a href="https://translate-api.sdlbeglobal.com/documentation/index.html#asynchronous-translation"&gt;translation endpoints&lt;/a&gt; named&amp;nbsp;&lt;strong&gt;translationMode&lt;/strong&gt; that was made available as of &lt;a href="/product-groups/machine_translation/cloud/w/changelog/5246/4-3-x-cumulative-updates"&gt;v4.3.4&lt;/a&gt;.&amp;nbsp; This parameter allows the integrator to specify a preference to the translation service to perform a &amp;quot;speed&amp;quot; or &amp;quot;quality&amp;quot; decoding if possible.&amp;nbsp;&amp;nbsp;Currently&amp;nbsp;the translation service&amp;nbsp;supports two translation modes: &amp;quot;speed&amp;quot; and &amp;quot;quality&amp;quot;. &lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;In &amp;ldquo;quality mode&amp;rdquo;, our algorithms perform an extended statistical search, which sometimes results in a better quality output. &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;&amp;ldquo;Speed mode&amp;rdquo; is instead optimized towards returning a translation as fast as possible.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;This translationMode can be globally set on a per account basis (however, not available via the UI). Every translation in that account will translate using that setting, unless explicitly overridden from the API call.&amp;nbsp; When this parameter is not used, the translation service automatically decide which mode to perform&amp;nbsp;on each translation based on&amp;nbsp;SDL&amp;nbsp;proprietary heuristic.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:200%;"&gt;Use synchronous translation endpoint&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;The synchronous translation endpoint is recommended for integration where there is absolute certainty that the input source is always no longer than 1,000 characters, or 200 words.&amp;nbsp; As with any synchronous requests, the server does not respond until the action is complete.&amp;nbsp; For use-cases where the input is certainly always short, the wait time for a sync response will most likely be more minimal compared to the polling for status process of an asynchronous request.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;See the page on &lt;a href="/product-groups/machine_translation/cloud/w/beglobal_wiki/5122/synchronous-translation"&gt;Synchronous translation&lt;/a&gt;&amp;nbsp;for more details.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;1&amp;nbsp;&lt;a href="https://www.imperva.com/learn/performance/http-keep-alive/"&gt;https://www.imperva.com/learn/performance/http-keep-alive/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div id="vidyowebrtcscreenshare_is_installed"&gt;&lt;/div&gt;
&lt;div id="vidyowebrtcscreenshare_is_installed"&gt;&lt;/div&gt;
&lt;div id="vidyowebrtcscreenshare_is_installed"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Optimize integration for speed</title><link>https://community.rws.com/product-groups/linguistic-ai/cloud/w/language-weaver-wiki/5229/optimize-integration-for-speed/revision/2</link><pubDate>Fri, 07 Feb 2020 00:56:46 GMT</pubDate><guid isPermaLink="false">10acfa76-f078-475b-a7ef-fc5b3e8d2934:0c26f191-c8b2-41a3-89e8-08d54fb20eb5</guid><dc:creator>Quinn Lam (former member)</dc:creator><comments>https://community.rws.com/product-groups/linguistic-ai/cloud/w/language-weaver-wiki/5229/optimize-integration-for-speed#comments</comments><description>Revision 2 posted to Wiki by Quinn Lam (former member) on 2/7/2020 12:56:46 AM&lt;br /&gt;
&lt;p&gt;&lt;span style="font-size:200%;"&gt;Use Keep-Alive&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;One of the most simple thing that you can do to improve your workflow with SDL Machine Translation Cloud is to use Keep-Alive in your calls.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;HTTP keep-alive, a.k.a., HTTP persistent connection, is an instruction that allows a single TCP connection to remain open for multiple HTTP requests/responses.&amp;quot;&lt;sup&gt;1&lt;/sup&gt;&amp;nbsp;- &lt;a href="https://www.imperva.com/learn/performance/http-keep-alive/"&gt;Imperva&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Want to&amp;nbsp;quantify how this can actually help your integration?&amp;nbsp; Try the following.&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;Create a new file called &amp;quot;connection-test.txt&amp;quot; and paste in this:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;    time_namelookup:  %{time_namelookup}\n
       time_connect:  %{time_connect}\n
    time_appconnect:  %{time_appconnect}\n
   time_pretransfer:  %{time_pretransfer}\n
      time_redirect:  %{time_redirect}\n
 time_starttransfer:  %{time_starttransfer}\n
                    ----------\n
         time_total:  %{time_total}\n&lt;/code&gt;&lt;/pre&gt;
&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;Make a request to SDL MT Cloud REST API server (update the request sample below with your own credentials)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;curl -w &amp;quot;@connection-test.txt&amp;quot; -XPOST -H &amp;quot;Content-type: application/json&amp;quot; \&lt;br /&gt;-d &amp;#39;{&amp;quot;clientId&amp;quot;: &amp;quot;&lt;span style="color:#808080;"&gt;F0ZUe28HFE8eaMLRLGJrIK0M6WGI9Nu&lt;/span&gt;&amp;quot;, &amp;quot;clientSecret&amp;quot;: &amp;quot;&lt;span style="color:#808080;"&gt;HFE8etNdtUP1liTrIKCtvlbGZ8Bv6Sxb-TAO_etNdHEcbWGu0KPGkVIu4QjiNEBt&lt;/span&gt;&amp;quot;}&amp;#39; \&lt;br /&gt;&amp;quot;&lt;/code&gt;&lt;code&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//translate-api.sdlbeglobal.com/v4/token&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;span&gt;Repeat step 2&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&amp;nbsp;Because curl has keep-alive on as a default, you can compare the &amp;quot;time_connect&amp;quot; between the response for #2 and #3.&amp;nbsp; The difference between these two values is&amp;nbsp;approximately the time your program will save by making requests with keep-alive option enabled.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;While at first glance, the time save may seem very minimal, but it is significant for any integrations that do many translation requests and polls per minute.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:200%;"&gt;Store and reuse authentication tokens&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;All requests to the SDL MT Cloud REST API requires a valid authentication token.&amp;nbsp; We recommend to request&amp;nbsp;a token once and store it, then only request a new one when the token expires. This way you will get the best performance possible, as your application will not make an extra request for every translation call (this extra request will add up after a while if the application has high translation needs).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;1&amp;nbsp;&lt;a href="https://www.imperva.com/learn/performance/http-keep-alive/"&gt;https://www.imperva.com/learn/performance/http-keep-alive/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div id="vidyowebrtcscreenshare_is_installed"&gt;&lt;/div&gt;
&lt;div id="vidyowebrtcscreenshare_is_installed"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Optimize integration for speed</title><link>https://community.rws.com/product-groups/linguistic-ai/cloud/w/language-weaver-wiki/5229/optimize-integration-for-speed/revision/1</link><pubDate>Fri, 07 Feb 2020 00:56:21 GMT</pubDate><guid isPermaLink="false">10acfa76-f078-475b-a7ef-fc5b3e8d2934:0c26f191-c8b2-41a3-89e8-08d54fb20eb5</guid><dc:creator>Quinn Lam (former member)</dc:creator><comments>https://community.rws.com/product-groups/linguistic-ai/cloud/w/language-weaver-wiki/5229/optimize-integration-for-speed#comments</comments><description>Revision 1 posted to Wiki by Quinn Lam (former member) on 2/7/2020 12:56:21 AM&lt;br /&gt;
&lt;p&gt;&lt;span style="font-size:200%;"&gt;Use Keep-Alive&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;One of the most simple thing that you can do to improve your workflow with SDL Machine Translation Cloud is to use Keep-Alive in your calls.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;HTTP keep-alive, a.k.a., HTTP persistent connection, is an instruction that allows a single TCP connection to remain open for multiple HTTP requests/responses.&amp;quot;&lt;sup&gt;1&lt;/sup&gt;&amp;nbsp;- &lt;a href="https://www.imperva.com/learn/performance/http-keep-alive/"&gt;Imperva&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Want to&amp;nbsp;quantify how this can actually help your integration?&amp;nbsp; Try the following.&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;Create a new file called &amp;quot;connection-test.txt&amp;quot; and paste in this:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;    time_namelookup:  %{time_namelookup}\n
       time_connect:  %{time_connect}\n
    time_appconnect:  %{time_appconnect}\n
   time_pretransfer:  %{time_pretransfer}\n
      time_redirect:  %{time_redirect}\n
 time_starttransfer:  %{time_starttransfer}\n
                    ----------\n
         time_total:  %{time_total}\n&lt;/code&gt;&lt;/pre&gt;
&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;Make a request to SDL MT Cloud REST API server (update the request sample below with your own credentials)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;pre&gt;&lt;code&gt;curl -w &amp;quot;@connection-test.txt&amp;quot; -XPOST -H &amp;quot;Content-type: application/json&amp;quot; \&lt;br /&gt;-d &amp;#39;{&amp;quot;clientId&amp;quot;: &amp;quot;&lt;span style="color:#808080;"&gt;F0ZUe28HFE8eaMLRLGJrIK0M6WGI9Nu&lt;/span&gt;&amp;quot;, &amp;quot;clientSecret&amp;quot;: &amp;quot;&lt;span style="color:#808080;"&gt;HFE8etNdtUP1liTrIKCtvlbGZ8Bv6Sxb-TAO_etNdHEcbWGu0KPGkVIu4QjiNEBt&lt;/span&gt;&amp;quot;}&amp;#39; \&lt;br /&gt;&amp;quot;&lt;/code&gt;&lt;code&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//translate-api.sdlbeglobal.com/v4/token&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;span&gt;Repeat step 2&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&amp;nbsp;Because curl has keep-alive on as a default, you can compare the &amp;quot;time_connect&amp;quot; between the response for #2 and #3.&amp;nbsp; The difference between these two values is&amp;nbsp;approximately the time your program will save by making requests with keep-alive option enabled.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;While at first glance, the time save may seem very minimal, but it is significant for any integrations that do many translation requests and polls per minute.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:200%;"&gt;Store and reuse authentication tokens&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;All requests to the SDL MT Cloud REST API requires a valid authentication token.&amp;nbsp; We recommend to request&amp;nbsp;a token once and store it, then only request a new one when the token expires. This way you will get the best performance possible, as your application will not make an extra request for every translation call (this extra request will add up after a while if the application has high translation needs).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;1&amp;nbsp;&lt;a href="https://www.imperva.com/learn/performance/http-keep-alive/"&gt;https://www.imperva.com/learn/performance/http-keep-alive/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div id="vidyowebrtcscreenshare_is_installed"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item></channel></rss>