<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Yes, the test1a() runs faster in Intel® Distribution for Python*</title>
    <link>https://community.intel.com/t5/Intel-Distribution-for-Python/Why-my-test-shows-that-Intel-Python-is-actually-slower-than/m-p/1145131#M1028</link>
    <description>&lt;P&gt;Yes, the test1a() runs faster in Anaconda then in IDP, but we have not gotten to the bottom of the issue yet.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Oct 2017 12:33:21 GMT</pubDate>
    <dc:creator>Oleksandr_P_Intel</dc:creator>
    <dc:date>2017-10-27T12:33:21Z</dc:date>
    <item>
      <title>Why my test shows that Intel Python is actually slower than Anaconda Python?</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/Why-my-test-shows-that-Intel-Python-is-actually-slower-than/m-p/1145128#M1025</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;

&lt;P&gt;My test example shows that Intel Distribution for Python 2018 is actually slower than the Anaconda Python 5.0.0. Why is that? Is there anything I can do fix the speed?&lt;/P&gt;

&lt;P style="box-sizing: border-box; margin-top: 1em; margin-bottom: 0px; color: rgb(0, 0, 0); font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px;"&gt;&lt;STRONG style="box-sizing: border-box;"&gt;How I install the Python Distribution:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE style="box-sizing: border-box; overflow: auto; font-family: monospace; font-size: 14px; padding: 0px; margin: 1em 2em; line-height: inherit; word-break: break-all; word-wrap: break-word; color: rgb(0, 0, 0); border: 0px; border-radius: 2px; white-space: pre-wrap;"&gt;&lt;CODE style="box-sizing: border-box; font-family: monospace; font-size: 14px; padding: 0px; border-radius: 0px; border: 0px;"&gt;1. Anaconda 5.0.0 Python 3.6.2
    // Installation Instruction
    Just download and install from &lt;A href="https://repo.continuum.io/archive/Anaconda3-5.0.0-Windows-x86_64.exe" target="_blank"&gt;https://repo.continuum.io/archive/Anaconda3-5.0.0-Windows-x86_64.exe&lt;/A&gt;

2. Intel Distribution for Python 3.6.2   
    // Installation Instruction (after completed step 1)
    conda config --add channels intel 
    conda create --name intelpy3 intelpython3_full python=3 statsmodels
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P style="box-sizing: border-box; margin-top: 1em; margin-bottom: 0px; color: rgb(0, 0, 0); font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="box-sizing: border-box; margin-top: 1em; margin-bottom: 0px; color: rgb(0, 0, 0); font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px;"&gt;&lt;STRONG style="box-sizing: border-box;"&gt;Machine Setup and Result&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE style="box-sizing: border-box; overflow: auto; font-family: monospace; font-size: 14px; padding: 0px; margin: 1em 2em; line-height: inherit; word-break: break-all; word-wrap: break-word; color: rgb(0, 0, 0); border: 0px; border-radius: 2px; white-space: pre-wrap;"&gt;&lt;CODE style="box-sizing: border-box; font-family: monospace; font-size: 14px; padding: 0px; border-radius: 0px; border: 0px;"&gt;1. Intel Xeon E5-2673v4 (32 Cores) 2.3Hz, 128DDR3, WinServer 2016 Datacenter x64 VM (Azure)
    Anaconda : 38s, 95s
    Intel    : 42s, 108s

2. Intel Corei5-3350P (4 Cores) 3.5Hz, 24GB DDR3, Win7x64 VM (Virtual Box)
    Anaconda : 72s, 130s
    Intel    : 82s, 165s&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-weight: 700; color: rgb(0, 0, 0); font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; box-sizing: border-box;"&gt;Source Code&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:python;"&gt;import sys
import time
import numpy as np
import pandas as pd
import statsmodels.formula.api as smf


def test1():
    cols = 13
    rows = 10000000
    raw_data = np.random.randint(2, size=cols * rows).reshape(rows, cols)
    col_names = ['v01', 'v02', 'v03', 'v04', 'v05', 'v06', 'v07',
                 'v08', 'v09', 'v10', 'v11', 'v12', 'outcome']
    df = pd.DataFrame(raw_data, columns=col_names)
    df['v11'] = df['v03'].apply(
        lambda x: ['t1', 't2', 't3', 't4'][np.random.randint(4)])
    df['v12'] = df['v03'].apply(lambda x: ['p1', 'p2'][np.random.randint(2)])
    return df


def test2(df):
    logit_formula = 'outcome ~ v01 + v02 + v03 + v04 + v05 + v06 + v07 + v08 + v09 + v10 + C(v11) + C(v12)'
    logit_model = smf.logit(formula=logit_formula, data=df).fit()
    print(logit_model.summary())


start_time = time.time()
df = test1()
t1 = time.time() - start_time

start_time = time.time()
test2(df)
t2 = time.time() - start_time

print(sys.version, "\nTest1: {}sec, Test2: {}sec".format(t1, t2))&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 22:32:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/Why-my-test-shows-that-Intel-Python-is-actually-slower-than/m-p/1145128#M1025</guid>
      <dc:creator>jeff_c_</dc:creator>
      <dc:date>2017-10-20T22:32:54Z</dc:date>
    </item>
    <item>
      <title>Hi, </title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/Why-my-test-shows-that-Intel-Python-is-actually-slower-than/m-p/1145129#M1026</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;
	&lt;BR /&gt;
	Thank for the reproducer. We can reproduce your observation and are looking into what makes IDP slower in this case. While we looking at this, I'd like to point it that creation of the DataFrame can be done about 10 times faster as follows:&lt;/P&gt;

&lt;PRE class="brush:python;"&gt;def test1a():
    cols = 13
    rows = 10000000
    raw_data = np.random.randint(2, size=(rows,cols))
    col_names = ['v01', 'v02', 'v03', 'v04', 'v05', 'v06', 'v07',
                 'v08', 'v09', 'v10', 'v11', 'v12', 'outcome']
    df = pd.DataFrame(raw_data, columns=col_names)
    df['v11'] = np.take(
        np.array(['t1', 't2', 't3', 't4'], dtype=object),
        np.random.randint(4, size=rows))
    df['v12'] = np.take(
        np.array(['p1', 'p2'], dtype=object),
        np.random.randint(2, size=rows))
    return df
&lt;/PRE&gt;

&lt;P&gt;While execution of test1() takes about 30 seconds, execution of test1a() only&amp;nbsp;&lt;BR /&gt;
	takes about 3 seconds.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 01:47:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/Why-my-test-shows-that-Intel-Python-is-actually-slower-than/m-p/1145129#M1026</guid>
      <dc:creator>Oleksandr_P_Intel</dc:creator>
      <dc:date>2017-10-23T01:47:06Z</dc:date>
    </item>
    <item>
      <title>Wow, 10x improvement on test1</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/Why-my-test-shows-that-Intel-Python-is-actually-slower-than/m-p/1145130#M1027</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Wow, 10x improvement on test1() is huge! Thank you very much Oleksandr.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;On test1() alone, the Anaconda Python on my machine is still slightly faster than Intel Python. Did you see the same result on your system that Intel Python being slower?&lt;/P&gt;

&lt;P&gt;2.265s vs 2.882s&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 00:44:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/Why-my-test-shows-that-Intel-Python-is-actually-slower-than/m-p/1145130#M1027</guid>
      <dc:creator>jeff_c_</dc:creator>
      <dc:date>2017-10-24T00:44:00Z</dc:date>
    </item>
    <item>
      <title>Yes, the test1a() runs faster</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/Why-my-test-shows-that-Intel-Python-is-actually-slower-than/m-p/1145131#M1028</link>
      <description>&lt;P&gt;Yes, the test1a() runs faster in Anaconda then in IDP, but we have not gotten to the bottom of the issue yet.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 12:33:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/Why-my-test-shows-that-Intel-Python-is-actually-slower-than/m-p/1145131#M1028</guid>
      <dc:creator>Oleksandr_P_Intel</dc:creator>
      <dc:date>2017-10-27T12:33:21Z</dc:date>
    </item>
    <item>
      <title>Has this been elucidated</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/Why-my-test-shows-that-Intel-Python-is-actually-slower-than/m-p/1145132#M1029</link>
      <description>&lt;P&gt;Has this been elucidated/fixed in the latest versions ?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 15:51:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/Why-my-test-shows-that-Intel-Python-is-actually-slower-than/m-p/1145132#M1029</guid>
      <dc:creator>Benahmed__Yacine</dc:creator>
      <dc:date>2019-04-18T15:51:26Z</dc:date>
    </item>
  </channel>
</rss>

