2007年04月03日 星期二 23:35
On 3/11/07, Jerry Xue <buuker在gmail.com> wrote: > > ironpython IronPythonÊÇÓÃC#ʵÏÖµÄpython½âÊÍÆ÷°É ÔÚ07-3-11£¬wentrue <guozhuwen在gmail.com> дµÀ£º > > > > MSҲѡÔñÁËpythonÂð£¿ÏÖÔÚMSÓÐЩʲô¶«Î÷ÊÇÓÃpython×öµÄ£¿ > > > > ÔÚ07-3-11£¬Jerry Xue < buuker在gmail.com> дµÀ£º > > > > > > > > > ²»´í£¬JITÊǽű¾ºÍ¿çƽ̨ÓïÑÔÌá¸ßЧÂʵÄ×îºÃ£¬¿ÉÄÜÒ²ÊÇ×îÖյİ취ÁË£¬ÆäʵÈç¹ûÄÜÈÃJVM°ÑPYTHONÖ±½Ó±àÒë³É×Ö½ÚÂ룬Ȼºó¶¼½»¸øJVMÒ²ÊÇÒ»¸öºÃ°ì·¨£¬¶ø²»ÊÇJYTHONµÄ½âÊÍ·½Ê½¡£¿Éϧ£¬sunºÃÏñ¶ÔRUBY¸ü¸ÐÐËȤ¡£Òà»òÊǽö½öÒòΪMSÑ¡ÔñÁËPYTHON£¬ËùÒÔsunÒ»¶¨ÒªÑ¡ÔñÒ»¸ö²»Ò»ÑùµÄ > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- Davies Liu My Blog: http://blog.daviesliu.net/ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070403/e3e3c214/attachment.htm
2007年04月06日 星期五 03:29
用linux的time命令来测试了上面的程序,python2.5 vs JDK 1.6,结果如下: ------------------------------------Python--------------------------------------------- -------- ConsoleTest -------- 0.14user 0.01system 0:00.24elapsed 63%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+717minor)pagefaults 0swaps -------- HashTest -------- 0.66user 0.00system 0:00.71elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+721minor)pagefaults 0swaps -------- IOTest -------- 2.00user 0.04system 0:03.17elapsed 64%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+718minor)pagefaults 0swaps -------- ListTest -------- 0.68user 0.01system 0:00.79elapsed 88%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+716minor)pagefaults 0swaps -------- ObjectTest -------- 1.22user 0.00system 0:01.31elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+715minor)pagefaults 0swaps -------- SpeedTest -------- 1.54user 0.01system 0:01.59elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+714minor)pagefaults 0swaps -----------------------------------------------Java-------------------------------------------- -------- ConsoleTest -------- 0.46user 0.08system 0:00.64elapsed 84%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (1major+2788minor)pagefaults 0swaps -------- HashTest -------- 0.35user 0.02system 0:00.50elapsed 75%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (1major+2757minor)pagefaults 0swaps -------- IOTest -------- 0.65user 0.06system 0:00.86elapsed 83%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (1major+2799minor)pagefaults 0swaps -------- ListTest -------- 0.22user 0.02system 0:00.47elapsed 52%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (1major+2777minor)pagefaults 0swaps -------- ObjectTest -------- 0.07user 0.03system 0:00.59elapsed 17%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (1major+2750minor)pagefaults 0swaps -------- SpeedTest -------- 0.14user 0.02system 0:00.82elapsed 20%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (1major+2496minor)pagefaults 0swaps ------------------------------------------------------------------------------------------------- 总的来说,时间上除了ConsoleTest之外,其他都是java占优(即使是用时间*cpu占用率也是这样); 但从pagefaults来看,python比java少,说明python的footprint比较少。 打个比喻就是:JAVA开发是常规战,PYTHON的开发是游击战:),不知道这个说法是否合适。 PS:我爱游击战! -------------- 下一部分 -------------- 一个HTML附件被移除... URL: http://python.cn/pipermail/python-chinese/attachments/20070406/2e81baac/attachment.html
2007年04月06日 星期五 13:32
Python的内存回收是基于引用计数(也有mark&sweep;对付一些循环引用的情况),java的不是很清楚,但肯定不是引用计数。 引用计数的特征是将回收动作分散在程序运行期间,总的CPU消耗会比其他的回收技术多,但出现程序暂时中断的情况会很少。 java写的GUI程序不知道大家会不会感觉到,就是运行了一段时间后会出现挂起几秒的情况,这是由于内存回收程序暂时把程序中断了。 ObjectTest那个程序我是把循环从10000改到1000后测试的,原来的情况python运行了112秒! 我的看法是,做GUI的话Python比Java更合适,而Python在做后台服务的优势在于开发效率而不是运行效率。 在07-4-6,John fractal <johnfractal在gmail.com> 写道: > > 用linux的time命令来测试了上面的程序,python2.5 vs JDK 1.6,结果如下: > > ------------------------------------Python--------------------------------------------- > -------- ConsoleTest -------- > 0.14user 0.01system 0:00.24elapsed 63%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (0major+717minor)pagefaults 0swaps > > -------- HashTest -------- > 0.66user 0.00system 0:00.71elapsed 95%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (0major+721minor)pagefaults 0swaps > > -------- IOTest -------- > 2.00user 0.04system 0:03.17elapsed 64%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (0major+718minor)pagefaults 0swaps > > -------- ListTest -------- > 0.68user 0.01system 0:00.79elapsed 88%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (0major+716minor)pagefaults 0swaps > > -------- ObjectTest -------- > 1.22user 0.00system 0:01.31elapsed 92%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (0major+715minor)pagefaults 0swaps > > -------- SpeedTest -------- > 1.54user 0.01system 0:01.59elapsed 97%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (0major+714minor)pagefaults 0swaps > > > -----------------------------------------------Java-------------------------------------------- > -------- ConsoleTest -------- > 0.46user 0.08system 0:00.64elapsed 84%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (1major+2788minor)pagefaults 0swaps > > -------- HashTest -------- > 0.35user 0.02system 0:00.50elapsed 75%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (1major+2757minor)pagefaults 0swaps > > -------- IOTest -------- > 0.65user 0.06system 0:00.86elapsed 83%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (1major+2799minor)pagefaults 0swaps > > -------- ListTest -------- > 0.22user 0.02system 0:00.47elapsed 52%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (1major+2777minor)pagefaults 0swaps > > -------- ObjectTest -------- > 0.07user 0.03system 0:00.59elapsed 17%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (1major+2750minor)pagefaults 0swaps > > -------- SpeedTest -------- > 0.14user 0.02system 0:00.82elapsed 20%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (1major+2496minor)pagefaults 0swaps > > ------------------------------------------------------------------------------------------------- > > 总的来说,时间上除了ConsoleTest之外,其他都是java占优(即使是用时间*cpu占用率也是这样); > 但从pagefaults来看,python比java少,说明python的footprint比较少。 > > 打个比喻就是:JAVA开发是常规战,PYTHON的开发是游击战:),不知道这个说法是否合适。 > PS:我爱游击战! > > > -------------- 下一部分 -------------- 一个HTML附件被移除... URL: http://python.cn/pipermail/python-chinese/attachments/20070406/33a6ee49/attachment.html
2007年04月06日 星期五 14:45
ÎÒÖ»ÄÜ˵Äã¶Ô Java µÄÀí½âÓеãÎÊÌ⣬Java ÊÇ·Ö´úʽÀ¬»ø»ØÊÕ£¬ÒýÓüÆÊýÊÇÒ»¸ö·Ç³£»ù±¾µÄ¸ÅÄî¡£ ¾ÍËãÊÇ Python£¬¶ÔÓÚÀ¬»øÊÕ¼¯µÄÐÐΪҲÊDz»È·¶¨µÄ£¬Õâµã¸ú Java Ò»Ñù£¬Ö»²»¹ý Java ÐèÒª¸ü¶àµÄÄڴ棬À¬»ø»ØÊÕ³ÌÐò»¹µ½²»ÁË´ò¶Ï³ÌÐòÔËÐеļ¶±ð£¬ÒªÕâôÑÏÖØ£¬Java »¹ÄÜ»ìÂð£¬ÔõôҲÊÇÔÚÆóÒµÓ¦Óþþ¿¼ÑéµÄÓïÑÔ¡£ Ä¿Ç° Java ÔÚÖ§³Ö½Å±¾ÓïÑÔ·½ÃæÒª±È .NET ²îÒ»µã£¬JDK 7 Ô¤¼ÆÒª¼ÓÈë invokedynamic Ö§³Ö£¬ÕâÑùÏñ Jython ÕâÑùµÄÓïÑԾͿÉÒÔ½« AST ½øÒ»²½·Òë³É bytecode Ö±½ÓÖ´ÐÐÁË£¬²»¹ýÕâÑù´øÀ´µÄ¶Ô JVM µÄ¸Ä¶¯¾ÍºÜ´ó£¬±Ï¾¹ Java ÊÇһ޲̬ÓïÑÔ£¬Ö§³Ö¶¯Ì¬ÌØÐÔ»¹ÊÇÐèÒª¸Ä²»ÉÙ¶«Î÷¡£ ;-) PS£º±È½ÏÄĸöÓïÑÔ¿ì²»¿ìÕæµÄûÒâ˼£¬ÎÒÊÇÒ»¸ö"Õýͳ"µÄ Java ¿ª·¢Õߣ¬µ«ÊÇÎÒºÜÀÁ£¬ÓÚÊÇÎÒÄ¿Ç°×ÜÊÇÓà Python ÔÚ䶫Î÷...... On 4/6/07, John fractal <johnfractal在gmail.com> wrote: > > PythonµÄÄÚ´æ»ØÊÕÊÇ»ùÓÚÒýÓüÆÊý£¨Ò²ÓÐmark&sweep;¶Ô¸¶Ò»Ð©Ñ»·ÒýÓõÄÇé¿ö£©£¬javaµÄ²»ÊǺÜÇå³þ£¬µ«¿Ï¶¨²»ÊÇÒýÓüÆÊý¡£ > > ÒýÓüÆÊýµÄÌØÕ÷Êǽ«»ØÊÕ¶¯×÷·ÖÉ¢ÔÚ³ÌÐòÔËÐÐÆڼ䣬×ܵÄCPUÏûºÄ»á±ÈÆäËûµÄ»ØÊÕ¼¼Êõ¶à£¬µ«³öÏÖ³ÌÐòÔÝʱÖжϵÄÇé¿ö»áºÜÉÙ¡£ > > javaдµÄGUI³ÌÐò²»ÖªµÀ´ó¼Ò»á²»»á¸Ð¾õµ½£¬¾ÍÊÇÔËÐÐÁËÒ»¶Îʱ¼äºó»á³öÏÖ¹ÒÆð¼¸ÃëµÄÇé¿ö£¬ÕâÊÇÓÉÓÚÄÚ´æ»ØÊÕ³ÌÐòÔÝʱ°Ñ³ÌÐòÖжÏÁË¡£ > > ObjectTestÄǸö³ÌÐòÎÒÊÇ°ÑÑ»·´Ó10000¸Äµ½1000ºó²âÊԵģ¬ÔÀ´µÄÇé¿öpythonÔËÐÐÁË112Ã룡 > > ÎҵĿ´·¨ÊÇ£¬×öGUIµÄ»°Python±ÈJava¸üºÏÊÊ£¬¶øPythonÔÚ×öºǫ́·þÎñµÄÓÅÊÆÔÚÓÚ¿ª·¢Ð§Âʶø²»ÊÇÔËÐÐЧÂÊ¡£ > > > ÔÚ07-4-6£¬John fractal <johnfractal在gmail.com > дµÀ£º > > > > ÓÃlinuxµÄtimeÃüÁîÀ´²âÊÔÁËÉÏÃæµÄ³ÌÐò£¬python2.5 vs JDK 1.6£¬½á¹ûÈçÏ£º > > ------------------------------------Python--------------------------------------------- > > > > -------- ConsoleTest -------- > > 0.14user 0.01system 0:00.24elapsed 63%CPU (0avgtext+0avgdata > > 0maxresident)k > > 0inputs+0outputs (0major+717minor)pagefaults 0swaps > > > > -------- HashTest -------- > > 0.66user 0.00system 0:00.71elapsed 95%CPU (0avgtext+0avgdata > > 0maxresident)k > > 0inputs+0outputs (0major+721minor)pagefaults 0swaps > > > > -------- IOTest -------- > > 2.00user 0.04system 0:03.17elapsed 64%CPU (0avgtext+0avgdata > > 0maxresident)k > > 0inputs+0outputs (0major+718minor)pagefaults 0swaps > > > > -------- ListTest -------- > > 0.68user 0.01system 0:00.79elapsed 88%CPU (0avgtext+0avgdata > > 0maxresident)k > > 0inputs+0outputs (0major+716minor)pagefaults 0swaps > > > > -------- ObjectTest -------- > > 1.22user 0.00system 0:01.31elapsed 92%CPU (0avgtext+0avgdata > > 0maxresident)k > > 0inputs+0outputs (0major+715minor)pagefaults 0swaps > > > > -------- SpeedTest -------- > > 1.54user 0.01system 0:01.59elapsed 97%CPU (0avgtext+0avgdata > > 0maxresident)k > > 0inputs+0outputs (0major+714minor)pagefaults 0swaps > > > > > > -----------------------------------------------Java-------------------------------------------- > > -------- ConsoleTest -------- > > 0.46user 0.08system 0:00.64elapsed 84%CPU (0avgtext+0avgdata > > 0maxresident)k > > 0inputs+0outputs (1major+2788minor)pagefaults 0swaps > > > > -------- HashTest -------- > > 0.35user 0.02system 0:00.50elapsed 75%CPU (0avgtext+0avgdata > > 0maxresident)k > > 0inputs+0outputs (1major+2757minor)pagefaults 0swaps > > > > -------- IOTest -------- > > 0.65user 0.06system 0:00.86elapsed 83%CPU (0avgtext+0avgdata > > 0maxresident)k > > 0inputs+0outputs (1major+2799minor)pagefaults 0swaps > > > > -------- ListTest -------- > > 0.22user 0.02system 0:00.47elapsed 52%CPU (0avgtext+0avgdata > > 0maxresident)k > > 0inputs+0outputs (1major+2777minor)pagefaults 0swaps > > > > -------- ObjectTest -------- > > 0.07user 0.03system 0:00.59elapsed 17%CPU (0avgtext+0avgdata > > 0maxresident)k > > 0inputs+0outputs (1major+2750minor)pagefaults 0swaps > > > > -------- SpeedTest -------- > > 0.14user 0.02system 0:00.82elapsed 20%CPU (0avgtext+0avgdata > > 0maxresident)k > > 0inputs+0outputs (1major+2496minor)pagefaults 0swaps > > > > ------------------------------------------------------------------------------------------------- > > > > ×ܵÄÀ´Ëµ£¬Ê±¼äÉϳýÁËConsoleTestÖ®Í⣬ÆäËû¶¼ÊÇjavaÕ¼ÓÅ£¨¼´Ê¹ÊÇÓÃʱ¼ä*cpuÕ¼ÓÃÂÊÒ²ÊÇÕâÑù£©£» > > µ«´ÓpagefaultsÀ´¿´£¬python±ÈjavaÉÙ£¬ËµÃ÷pythonµÄfootprint±È½ÏÉÙ¡£ > > > > ´ò¸ö±ÈÓ÷¾ÍÊÇ£ºJAVA¿ª·¢Êdz£¹æÕ½£¬PYTHONµÄ¿ª·¢ÊÇÓλ÷Õ½£º£©£¬²»ÖªµÀÕâ¸ö˵·¨ÊÇ·ñºÏÊÊ¡£ > > PS£ºÎÒ°®Óλ÷Õ½£¡ > > > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- Nicholas @ Nirvana Studio http://www.nirvanastudio.org -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070406/596e4c6d/attachment.htm
2007年04月06日 星期五 19:18
On 4/6/07, Nicholas Ding <nicholasdsj在gmail.com> wrote: > > PS£º±È½ÏÄĸöÓïÑÔ¿ì²»¿ìÕæµÄûÒâ˼£¬ÎÒÊÇÒ»¸ö"Õýͳ"µÄ Java ¿ª·¢Õߣ¬µ«ÊÇÎÒºÜÀÁ£¬ÓÚÊÇÎÒÄ¿Ç°×ÜÊÇÓà Python ÔÚ䶫Î÷...... Ç¿ÁÒͬÒâÄãÕâÒ»µã£¬ÏÖÔÚÒѾ²»ÊǶÔËٶȺÍÄÚ´æÕ¼ÓÃÁ¿½ï½ï¼Æ½ÏµÄʱºòÁË£¬¸üÖØÒªµÄÊÇÈçºÎ¿ìËٵıí´ïÏë·¨£¬×·Ç󿪷¢µÄЧÂʺͿÉά»¤ÐÔ¡£ Davies -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070406/ae1c4198/attachment.htm
2007年04月06日 星期五 19:20
Davies Liu 写道: > 强烈同意你这一点,现在已经不是对速度和内存占用量斤斤计较的时候了,更重 > 要的是如何快速的表达想法,追求开发的效率和可维护性。 > 我觉得,用Python是一种很爽的事,用它写的代码很优雅,但是不敢在公司项目中 使用。
2007年04月06日 星期五 20:06
jythonÓëpythonÖ»ÊǽâÊÍÆ÷ÉϵIJ»Í¬£¿»¹ÊÇÒ»ÖÖȫеÄÓïÑÔ£¿ On 4/6/07, ÁÖ½Ü½Ü <limkatkat在gmail.com> wrote: > > Davies Liu дµÀ: > > Ç¿ÁÒͬÒâÄãÕâÒ»µã£¬ÏÖÔÚÒѾ²»ÊǶÔËٶȺÍÄÚ´æÕ¼ÓÃÁ¿½ï½ï¼Æ½ÏµÄʱºòÁË£¬¸üÖØ > > ÒªµÄÊÇÈçºÎ¿ìËٵıí´ïÏë·¨£¬×·Ç󿪷¢µÄЧÂʺͿÉά»¤ÐÔ¡£ > > > ÎÒ¾õµÃ£¬ÓÃPythonÊÇÒ»ÖÖºÜˬµÄÊ£¬ÓÃËüдµÄ´úÂëºÜÓÅÑÅ£¬µ«ÊDz»¸ÒÔÚ¹«Ë¾ÏîÄ¿ÖÐ > ʹÓᣠ> _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -- ×¢ÒâÉíÌ壬ÉíÌåÊǸïÃüµÄ±¾Ç®£¡£¡ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070406/0a69cd2a/attachment.html
Zeuux © 2025
京ICP备05028076号