tag:blogger.com,1999:blog-11788780.post7462099185325522435..comments2023-12-29T13:22:33.104-08:00Comments on JJinuxLand: Java: Helloooooooo, World!jjinuxhttp://www.blogger.com/profile/03270879497119114175noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-11788780.post-53518539171930194562012-11-08T02:25:54.592-08:002012-11-08T02:25:54.592-08:00what about python -S ... I bet it's even faste...what about python -S ... I bet it's even faster ;)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11788780.post-68136733959647479122012-10-12T18:43:48.822-07:002012-10-12T18:43:48.822-07:00> Why did they need to import Django's ORM ...> Why did they need to import Django's ORM in a shell script? Seems to me like a poorly designed script. Many cases we programmers make poor decisions and write bad code and then blame the language.<br /><br />It's not uncommon to have to access a database from the command line. Sometimes, you want to use the ORM to do that, in order to make use of the logic the ORM provides.<br /><br />Sometimes you have to do this to do very complicated database maintenance or migrations. Perhaps you need to write a script that pulls all the user accounts and sends them bulk email. At least in the Ruby on Rails world, I've written multiple scripts that had to make use of the ORM.jjinuxhttps://www.blogger.com/profile/03270879497119114175noreply@blogger.comtag:blogger.com,1999:blog-11788780.post-41528622140132390962012-09-11T11:16:02.979-07:002012-09-11T11:16:02.979-07:00(Oops, I accidentally deleted a comment I didn'...(Oops, I accidentally deleted a comment I didn't mean to delete:)<br /><br />Roberto Guerra has left a new comment on your post "Java: Helloooooooo, World!": <br /><br />Why did they need to import Django's ORM in a shell script? Seems to me like a poorly designed script. Many cases we programmers make poor decisions and write bad code and then blame the language. jjinuxhttps://www.blogger.com/profile/03270879497119114175noreply@blogger.comtag:blogger.com,1999:blog-11788780.post-14674871216117933752012-09-11T10:59:37.441-07:002012-09-11T10:59:37.441-07:00I have 1.7 JDK on a Windows box and I only loaded ...I have 1.7 JDK on a Windows box and I only loaded 361 classes... well only being relative I supposeJoe "Rotund" Tennieshttps://www.blogger.com/profile/15738276878886073220noreply@blogger.comtag:blogger.com,1999:blog-11788780.post-48577391751982309622012-09-11T09:21:03.183-07:002012-09-11T09:21:03.183-07:00For my linux desktop:
>time java -cp . HelloWo...For my linux desktop:<br /><br />>time java -cp . HelloWorld -verbose:class<br />Hello World<br /><br />real 0m0.055s<br />user 0m0.044s<br />sys 0m0.011s<br /><br />and loaded 314 classes.<br /><br />and for python:<br /><br />>time python HelloWorld.py <br />Hello World<br /><br />real 0m0.022s<br />user 0m0.018s<br />sys 0m0.003sAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-11788780.post-4984273427554830732012-08-30T07:44:11.837-07:002012-08-30T07:44:11.837-07:00Marius, that's a funny story. Spawning off a P...Marius, that's a funny story. Spawning off a Python shell script certainly qualifies as scalable (since you can just throw more hardware at the problem), but it's certainly not performant (0.5 seconds!) or efficient (that's really expensive in terms of memory).jjinuxhttps://www.blogger.com/profile/03270879497119114175noreply@blogger.comtag:blogger.com,1999:blog-11788780.post-18428126074603115112012-08-30T07:41:42.187-07:002012-08-30T07:41:42.187-07:00It may be a stupid benchmark, or it may be a real ...It may be a stupid benchmark, or it may be a real scalability issue, in some rare cases.<br /><br />I wish I had a link ready (or better Google skills), but I remember a blog post (or maybe it was a video of a talk? a live talk at EuroPython 2012?) by someone from Github about a performance problem they've identified. Turns out they used a Python script as a shell for ssh logins that did some checks and spawned git. The time to import all of Django's ORM was maybe 0.5 seconds, but when they had 50 incoming SSH connections a second, it all added up to quite a hefty load.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11788780.post-7966684479779549422012-08-29T15:43:59.563-07:002012-08-29T15:43:59.563-07:00On my machine, Go: 0.007s
Go has no class either ...On my machine, Go: 0.007s<br /><br />Go has no class either :-)<br />rognoreply@blogger.com