At now, i run my script in comand line with python 2.7 and got some results: ARRAY APPEND 0.463161945343 PYTHON CONCAT 0.374883890152 it's faster, than php )) yahoo But, thought python3, i've got: ARRAY APPEND 0.9795410633087158 PYTHON CONCAT 0.8521389961242676 ... hm.. why?
среда, 19 сентября 2012 г., 22:11:46 UTC+4 пользователь Виталий Нефедов написал: > > Jason, ths for answer. > Hm, you are not understand me. > Of course, it's python issue, but we know, that mod_wsgi has some > configuration. I mean, that i have bad configuration of apache + mod_wsgi. > I think, that someone write .. some "it's really slow, reconfigure apache, > python with some modes ". > I want get fastest method for text output. For example, output html data.. > But now, i see, that it's really slow, and i dont know, how i may optimize > it. > Of course, in real web-application 100k text iterations is imposible ) .. > however, may be xml modules .. but i'ts different topic > > > среда, 19 сентября 2012 г., 20:43:27 UTC+4 пользователь Jason Garber > написал: >> >> Hello Виталий, >> >> What you are talking about has nothing to do with mod_wsgi. This is a >> python issue. If you are interested in comparing Python vs. PHP for string >> manipulation speed ... >> >> 1. do it on the command line >> 2. why are you doing it? >> >> String speed tells such a small part of the story. If that is your >> focus, C++ or Java would be a better place to look. >> >> Anyway, mod_wsgi whips the pants off of PHP for performance in a >> real-world web application. The reason for this isn't that Python is a >> "faster" language -- it's because mod_wsgi is FAR more efficient than >> mod_php (default configurations). When you start to get into more complex >> sites, the difference becomes much more apparent. >> >> We have really complex web applications with thousands of active users >> purring on a single server with barely any load.... And the page response >> time is as fast as a windows application. >> >> Here is a benchmark I just did on comparable code: >> >> --- Login page delivered via Python+mod_wsgi --- dual core processor 2 gb >> ram server sata drive --- >> Document Length: 3045 bytes >> Concurrency Level: 20 >> Time taken for tests: 4.740 seconds >> Complete requests: 5000 >> Requests per second: 1054.75 [#/sec] (mean) >> >> --- Similar page delivered via PHP -- 8 core server with 16 gb ram 15k >> sas drives --- . >> Document Length: 1885 bytes >> Concurrency Level: 20 >> Time taken for tests: 8.076 seconds >> Complete requests: 5000 >> Requests per second: 619.09 [#/sec] (mean) >> >> Just a note from experience... Performance is very important. But your >> real performance issues are going to likely be with your database design >> (or mis-design), not your HTTP handler. >> >> Thanks! >> Jason >> >> On Wed, Sep 19, 2012 at 11:04 AM, Виталий Нефедов <[email protected]>wrote: >> >>> Hi, i start learn *python3* and have some problem with execute time. >>> I testing execute time speed on there methods >>> >>> toop >>> for i in range ( N ) >>> ... >>> a = '' >>> a += (string + str(i)); >>> ... >>> a = [] >>> a.append(string + str(i)) >>> ... >>> a = StringIO() >>> a.write(string + str(i)) >>> >>> on N = 100000, i had some results: >>> >>> *STRING 1.0920219421386719* >>> * >>> **ARRAY 1.1565468311309814**StringIO 1.3690509796142578* >>> it's very .. very slow. >>> >>> Similar in php, i tested there methods on N = 100000 too: >>> loop >>> i < N N++ >>> ....... >>> $a .= $string . $i; >>> ... >>> $a[] = $string . $i; >>> >>> And i had some best results, it's really faster: >>> *STRING 0.38697910308838* *ARRAY 0.603670835495* >>> i try to configure mod_wsgi and i had there results on defauls settings. >>> I want get best results in python. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "modwsgi" group. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msg/modwsgi/-/W1Y6HGpKFzEJ. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/modwsgi?hl=en. >>> >> >> -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To view this discussion on the web visit https://groups.google.com/d/msg/modwsgi/-/WUr86hzHHFsJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
