<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.apertium.org/w/index.php?action=history&amp;feed=atom&amp;title=Profiling</id>
	<title>Profiling - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.apertium.org/w/index.php?action=history&amp;feed=atom&amp;title=Profiling"/>
	<link rel="alternate" type="text/html" href="https://wiki.apertium.org/w/index.php?title=Profiling&amp;action=history"/>
	<updated>2026-06-06T03:05:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.apertium.org/w/index.php?title=Profiling&amp;diff=63104&amp;oldid=prev</id>
		<title>Unhammer: Created page with &quot;To &quot;profile&quot; a language pair to see which part of the pipeline is the slowest, run each step one at a time. Here&#039;s a helper that will do that for you:  &lt;pre&gt; apertium_time_mod...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.apertium.org/w/index.php?title=Profiling&amp;diff=63104&amp;oldid=prev"/>
		<updated>2017-05-24T09:05:50Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;To &amp;quot;profile&amp;quot; a language pair to see which part of the pipeline is the slowest, run each step one at a time. Here&amp;#039;s a helper that will do that for you:  &amp;lt;pre&amp;gt; apertium_time_mod...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;To &amp;quot;profile&amp;quot; a language pair to see which part of the pipeline is the slowest, run each step one at a time. Here&amp;#039;s a helper that will do that for you:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apertium_time_mode () {&lt;br /&gt;
    local mode=$1 print=$2&lt;br /&gt;
    local -a cmds res&lt;br /&gt;
    IFS=$&amp;#039;\0&amp;#039; res=( $(cat) )       # slurp into first element of array&lt;br /&gt;
    IFS=$&amp;#039;\n&amp;#039; cmds=( $(tr &amp;#039;|&amp;#039; &amp;#039;\n&amp;#039; &amp;lt; modes/&amp;quot;${mode}&amp;quot;.mode | grep &amp;#039;[^ ]&amp;#039; | sed &amp;#039;s/[$]1/-d/g; s/[$]2//g&amp;#039; ) )&lt;br /&gt;
    for i in $(seq 0 &amp;quot;${#cmds[@]}&amp;quot;); do&lt;br /&gt;
        cmd=&amp;quot;${cmds[$i]}&amp;quot;&lt;br /&gt;
        echo &amp;quot;$cmd&amp;quot;&lt;br /&gt;
        m=$(( i + 1 ))&lt;br /&gt;
        time res[$m]=$(echo &amp;quot;${res[$i]}&amp;quot; | eval &amp;quot;$cmd&amp;quot;)&lt;br /&gt;
        if [[ -n $print ]]; then&lt;br /&gt;
            echo &amp;quot;${res[$m]}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo &amp;#039;Boađus ii leat nu buorre go mun háliidan.&amp;#039;| apertium_time_mode sme-nob&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to also see the output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo &amp;#039;Boađus ii leat nu buorre go mun háliidan.&amp;#039;| apertium_time_mode sme-nob print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Unhammer</name></author>
		
	</entry>
</feed>