Pyhton Interpreter启动时间 [英] Pyhton Interpreter Startup time

查看:72
本文介绍了Pyhton Interpreter启动时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我正在寻找一个小应用程序,它需要一个非常快的启动时间来为Python解释器启动时间。它没有做太多(复制

和文件缓存,没有GUI)但我需要Python解释器以非常快的速度启动

(<1秒开启一个Windows框)。有没有办法让一个

''剥离''Python解释器,它可以在一个

的Windows框中快速启动。我曾经想过的事情是使用PyExe来快速启动它(它是否编译成C代码,因此在运行时不使用

Python解释器?) 。这是一个可能的解决方案吗?


我观察到我第二次启动python它启动得更快

但是我假设这取决于环境并且不能依赖(或类似的东西)。


先谢谢你的帮助。


干杯,

Neil


-


Neil Benn

高级自动化工程师

Cenix BioScience

BioInnovations Zentrum

Tatzberg 47

D -01307

德累斯顿

德国


电话:+49(0)351 4173 154

电子邮件: be**@cenix-bioscience.com

Cenix网站: http://www.cenix-bioscience.com

解决方案

Neil Benn写道:

我是厕所王在一个小应用程序,需要一个非常快速的Python解释器启动时间。它没有做太多(复制
和文件缓存,没有GUI),但我需要Python解释器快速启动(在Windows机器上<1秒)。



你有什么样的机器?


在我看来,Python在大约0.06秒内启动......


这个原始测试在Windows XP机器上显示这些结果

(它不能用于Windows 98,因为它无法在
这样的命令行,但你可以在批处理文件中。)


c:\> echo。 |时间& python -c" import time; print time.time()"

当前时间是:8:59:59.67

输入新时间:

1092315599.73


这是一台相当快的机器(Athlon 2500+),但我真的好了b / b
怀疑速度慢的机器需要的时间比1秒钟长很多

除非他们真的*老了。


-Peter


Peter Hansen写道......

Neil Benn写道:

我正在寻找一个小型应用程序,需要一个非常快速的Python解释器启动时间。它没有做太多(复制
和文件缓存,没有GUI),但我需要Python解释器快速启动(在Windows机器上<1秒)。


你有什么样的机器?

在我看来,Python在大约0.06秒内启动...

这个原始测试显示这些结果在Windows XP机器上(它不能用于Windows 98,因为它不能像这样在
命令行上链接命令,但你可以但它在批处理文件中) 。

c:\>回声。 |时间& python -c" import time; print time.time()"
当前时间是:8:59:59.67
输入新时间:
1092315599.73
这是一台相当快的机器(Athlon 2500+)但我确实怀疑速度较慢的机器需要的时间超过1秒
除非它们确实*老了。

-Peter




这个Peter的时间变化

来自运行Linux / Debian的5岁250 MHz Compaq

。 ..


sk @ cpq1:〜/ c


./ gtod& python -c" import time;

print''Python ....'',time.time()"

[1] 1677


秒数......... 1092323003

微秒数.... 194433

时区...... .......... 420

夏令时..... 0

Python .... 1092323003.36

-

Cousin Stanley

人类

亚利桑那州凤凰城


Hello,

I''m looking at a small app which would need a very quick
startup time for the Python interpreter. It doesn''t do much (copying
and caching of files, no GUI) but I need the Python interpreter to start
up very quickly (<1 second on a Windows box). Is there a way to have a
''stripped'' down Python interpreter which can start up very quickly on a
windows box. Once thing I was thinking of was to use PyExe to make a
quick startup (does it compile down to C code, therefore not using the
Python interpreter at runtime?). Is this a possible solution?

I observe that the second time I start python it starts up quicker
but I''m assuming that this is dependent on the environment and can''t be
relied upon (or something like that).

Thanks, in advance for your help.

Cheers,

Neil

--

Neil Benn
Senior Automation Engineer
Cenix BioScience
BioInnovations Zentrum
Tatzberg 47
D-01307
Dresden
Germany

Tel : +49 (0)351 4173 154
e-mail : be**@cenix-bioscience.com
Cenix Website : http://www.cenix-bioscience.com

解决方案

Neil Benn wrote:

I''m looking at a small app which would need a very quick
startup time for the Python interpreter. It doesn''t do much (copying
and caching of files, no GUI) but I need the Python interpreter to start
up very quickly (<1 second on a Windows box).



What kind of machine do you have?

On mine, Python starts up in about 0.06 seconds...

This primitive test shows these results on a Windows XP machine
(it won''t work with Windows 98 as it can''t chain commands on the
command line like that, but you could but it in a batch file).

c:\>echo. | time & python -c "import time; print time.time()"
The current time is: 8:59:59.67
Enter the new time:
1092315599.73

This is a fairly fast machine (Athlon 2500+) but I really
doubt slower machines would take much longer than 1 second
unless they are *really* old.

-Peter


Peter Hansen wrote ....

Neil Benn wrote:

I''m looking at a small app which would need a very quick
startup time for the Python interpreter. It doesn''t do much (copying
and caching of files, no GUI) but I need the Python interpreter to start
up very quickly (<1 second on a Windows box).



What kind of machine do you have?

On mine, Python starts up in about 0.06 seconds...

This primitive test shows these results on a Windows XP machine
(it won''t work with Windows 98 as it can''t chain commands on the
command line like that, but you could but it in a batch file).

c:\>echo. | time & python -c "import time; print time.time()"
The current time is: 8:59:59.67
Enter the new time:
1092315599.73

This is a fairly fast machine (Athlon 2500+) but I really
doubt slower machines would take much longer than 1 second
unless they are *really* old.

-Peter



This variation on Peter''s timing
is from a 5-year-old 250 MHz Compaq
running Linux/Debian ...

sk@cpq1 : ~/c


./gtod & python -c "import time ;
print '' Python ....'' , time.time()"
[1] 1677

Number of seconds ......... 1092323003
Number of microseconds .... 194433
Time zone ................. 420
Daylight savings time ..... 0

Python .... 1092323003.36
--
Cousin Stanley
Human Being
Phoenix, Arizona


这篇关于Pyhton Interpreter启动时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆