<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[python3 startup time - ideas?]]></title><description><![CDATA[<p dir="auto">i've just written my 1st Omega app. When I press a button, my python3 code starts up, does some magic, and spells out today's weather forecast through a speaker.</p>
<p dir="auto">My challenge is python's startup time - it literally takes 30 seconds for it to load the libraries I need and begin work. Do you have any tricks to make it quicker? I know I could have it run as a daemon, but while I'm working on the code I would need some tool to apply changes without restarting the daemon.</p>
<p dir="auto">Michal</p>
]]></description><link>http://community.onion.io/topic/767/python3-startup-time-ideas</link><generator>RSS for Node</generator><lastBuildDate>Tue, 17 Mar 2026 15:29:11 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/767.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 12 May 2016 13:34:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to python3 startup time - ideas? on Thu, 12 May 2016 13:34:22 GMT]]></title><description><![CDATA[<p dir="auto">i've just written my 1st Omega app. When I press a button, my python3 code starts up, does some magic, and spells out today's weather forecast through a speaker.</p>
<p dir="auto">My challenge is python's startup time - it literally takes 30 seconds for it to load the libraries I need and begin work. Do you have any tricks to make it quicker? I know I could have it run as a daemon, but while I'm working on the code I would need some tool to apply changes without restarting the daemon.</p>
<p dir="auto">Michal</p>
]]></description><link>http://community.onion.io/post/5492</link><guid isPermaLink="true">http://community.onion.io/post/5492</guid><dc:creator><![CDATA[Michal Rok]]></dc:creator><pubDate>Thu, 12 May 2016 13:34:22 GMT</pubDate></item><item><title><![CDATA[Reply to python3 startup time - ideas? on Thu, 12 May 2016 22:16:20 GMT]]></title><description><![CDATA[<p dir="auto">Have you tried compiling to bytecode?</p>
]]></description><link>http://community.onion.io/post/5497</link><guid isPermaLink="true">http://community.onion.io/post/5497</guid><dc:creator><![CDATA[Samuel Mathieson]]></dc:creator><pubDate>Thu, 12 May 2016 22:16:20 GMT</pubDate></item><item><title><![CDATA[Reply to python3 startup time - ideas? on Fri, 13 May 2016 13:03:13 GMT]]></title><description><![CDATA[<p dir="auto">Tried to compile with py_compile - didn't help.</p>
<p dir="auto">According to "python3 -v" output, most of the time is spent reading system libraries. Take this simple file that does nothing:</p>
<hr />
<h2>import urllib.request<br />
import urllib.parse<br />
import json</h2>
<p dir="auto">Execution takes literally 20 seconds on my Omega.</p>
<p dir="auto">Michal</p>
]]></description><link>http://community.onion.io/post/5507</link><guid isPermaLink="true">http://community.onion.io/post/5507</guid><dc:creator><![CDATA[Michal Rok]]></dc:creator><pubDate>Fri, 13 May 2016 13:03:13 GMT</pubDate></item><item><title><![CDATA[Reply to python3 startup time - ideas? on Fri, 13 May 2016 14:40:52 GMT]]></title><description><![CDATA[<p dir="auto">were you able to compile or something wrong happened?<br />
If possible, would you be able to share the code using github or something else?</p>
<p dir="auto">Vinicius</p>
]]></description><link>http://community.onion.io/post/5513</link><guid isPermaLink="true">http://community.onion.io/post/5513</guid><dc:creator><![CDATA[Vinicius Batista]]></dc:creator><pubDate>Fri, 13 May 2016 14:40:52 GMT</pubDate></item><item><title><![CDATA[Reply to python3 startup time - ideas? on Fri, 13 May 2016 14:59:57 GMT]]></title><description><![CDATA[<p dir="auto">I have found that python 2 is faster than 3 on the omega. Have you tried using 2? Any reason you need 3?</p>
]]></description><link>http://community.onion.io/post/5515</link><guid isPermaLink="true">http://community.onion.io/post/5515</guid><dc:creator><![CDATA[Samuel Mathieson]]></dc:creator><pubDate>Fri, 13 May 2016 14:59:57 GMT</pubDate></item><item><title><![CDATA[Reply to python3 startup time - ideas? on Sat, 14 May 2016 06:45:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/969">@Vinicius-Batista</a> i was able to compile <em>my</em> code, but it wasn't any faster on startup</p>
]]></description><link>http://community.onion.io/post/5532</link><guid isPermaLink="true">http://community.onion.io/post/5532</guid><dc:creator><![CDATA[Michal Rok]]></dc:creator><pubDate>Sat, 14 May 2016 06:45:09 GMT</pubDate></item><item><title><![CDATA[Reply to python3 startup time - ideas? on Sat, 14 May 2016 06:52:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/582">@Samuel-Mathieson</a> no real reason to use py3 - I was learning Python so I thought I should start with the most recent version.</p>
<p dir="auto">The time it takes to start bare shell in python2/3 is in my case:</p>
<ul>
<li>4 seconds for Python 2.7</li>
<li>5.5 seconds for Python 3.4</li>
</ul>
<p dir="auto">But importing urllib.request increases the python3 startup time to 22 secs. For python2, importing urllib does not have that much impact (4-&gt;5.5).</p>
<p dir="auto">Michal</p>
]]></description><link>http://community.onion.io/post/5533</link><guid isPermaLink="true">http://community.onion.io/post/5533</guid><dc:creator><![CDATA[Michal Rok]]></dc:creator><pubDate>Sat, 14 May 2016 06:52:30 GMT</pubDate></item><item><title><![CDATA[Reply to python3 startup time - ideas? on Sat, 14 May 2016 14:56:46 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/1292">@Michal-Rok</a> .<br />
Python is an interpreted language, so this is usually slow during initialisation. I just created a small script that reads response from a rest service(http get) and print it on the oled expansion. It takes about 4 seconds to initialise. I believe that it's partially due to omega's hardware limitations.</p>
<p dir="auto">So, if initialisation time is something crucial for <em>your</em> project, I would suggest look for some alternatives - namely C and C++.</p>
<p dir="auto">Regards,<br />
Vinicius</p>
]]></description><link>http://community.onion.io/post/5538</link><guid isPermaLink="true">http://community.onion.io/post/5538</guid><dc:creator><![CDATA[Vinicius Batista]]></dc:creator><pubDate>Sat, 14 May 2016 14:56:46 GMT</pubDate></item><item><title><![CDATA[Reply to python3 startup time - ideas? on Sun, 15 May 2016 01:31:33 GMT]]></title><description><![CDATA[<p dir="auto">Like Vinicius said, if you have no real reason to use something like C and can get away with python, if it is not crucial to have a fast initialization time, I would go with Python. Also, the difference between python 2 and 3 is minimal. Really 3 is just making things a little more consistent. Mostly if you change your print "ok" to print("ok") that should do it. I would go with python 2.</p>
<p dir="auto">One suggestion. I have found that it is faster to use os.system() for some things rather than their python equivalents. Perhaps you could look into that?</p>
<p dir="auto">Regards,<br />
Sam.</p>
]]></description><link>http://community.onion.io/post/5549</link><guid isPermaLink="true">http://community.onion.io/post/5549</guid><dc:creator><![CDATA[Samuel Mathieson]]></dc:creator><pubDate>Sun, 15 May 2016 01:31:33 GMT</pubDate></item></channel></rss>