IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New It's flame war time!
[link|http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all|http://shootout.alio...test=all&lang=all]

Just to start off the fireworks: [link|http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=java&lang2=vw|http://shootout.alio...ang=java&lang2=vw]

Note the memory usage stats too. ;-)



Ruby does really, really poorly overall. I was surprised.

And yes, I know these are artificial benchmarks. It's still fun, and useful when you consider that, for larger sites at least, whatever time you save with a better language [link|http://poocs.net/articles/2006/03/13/the-adventures-of-scaling-stage-1|may be lost in optimization time] (tale of a Ruby on Rails site getting 1M+ dynamic page views per day).

For me, clearly there is no choice between Java and C++. The code and complexity overhead with C++ simply isn't worth whatever small performance gains you might see, in my opinion.

For smaller, non-performance sensitive applications, or for applications where you can architect and optimize, Python looks like a very good bet. It's a good bit faster than the other major "scripting" languages (Perl, PHP, Ruby) in these tests.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New I've been toying with a similar idea
Not so much aimed at benchmarking as algorithms. Thinking about taking [link|http://www.codepoetics.com/wiki/index.php?title=Topics:Knuth_in_other_languages|Knuth's TAOCP] and showing implementations in various languages. I've barely started - only a couple of algorithms and only in ML. But I thought it might be interesting to have a competition that focuses on algorithms instead of speed.
New And while I'm on the subject...
...maybe someone can help me with the following algorithm in Java. I think the problem is the representation of real numbers as integers (with implied decimal places). But Knuth doesn't have a MIX implementation to compare with, so I haven't been able to get my bearings.
/*\nAlgorithm 1.2.2L: Binary approximation of y = logb x\n\nSuppose that we have a binary computer and a number x, 1 <= x < 2.\nShow that the following algorithm, which uses only shifting addition, \nand subtraction operations proportional to the number of place of \naccuracy desired, may be used to calculate an approximation to \ny = logb x.\n\nL1. [Initialize]  Set y <- 0, z <- x shifted right 1, k <- 1.\nL2. [Test for end]  If x == 1, stop.\nL3. [Compare]  If x - z < 1, go to L5.\nL4. [Reduce values]  Set x <- x - z, z <- x shifted right k, \n                     y <- y + logb (2^k/(2^k - 1)), and go to L2.\nL5. [Shift]  Set z <- z shifted right 1, k <- k + 1, and go to L2.\n*/\n\npublic class Test {\n\n   // desired precision in bits\n   static long precision = 5;\n\n   // the log base\n   static long base = 10;\n\n   // convert double to binary representation\n   // (implied decimal places)\n   //   example: double2binary(1.5) = 150000\n   static long double2binary(double x)\n   {\n      return (long)(x * Math.pow(10, precision));\n   }\n\n   // convert binary back to double\n   // (backing out implied decimal places)\n   //    example: binary2double(150000) = 1.5\n   static double binary2double(double x)\n   {\n      return x / Math.pow(10, precision);\n   }\n\n   // shift right operation\n   //    example: shiftRight(12340) = 1234\n   static long shiftRight(long x, long n)\n   {\n      if (n == 0)\n      {\n         return x;\n      }\n      else\n      {\n         return shiftRight(x / base, n-1);\n      }\n   }\n\n   // mimic a fixed log table that is precision in length.\n   // eventually I'll convert to a lookup table.\n   static long logTable(long k)\n   {\n      return double2binary(\n         Math.log(Math.pow(2, k) / (Math.pow(2, k) - 1.0)) /\n            Math.log(base));\n   }\n\n   // test out the algorithm\n   public static void main(String[] args) {\n      // L1. Initialize values\n      long x = double2binary(1.5);\n      long y = 0;\n      long z = shiftRight(x, 1);\n      long k = 1;\n\n      // used to prevent infinite loop till I get it working\n      long i = 1;\n\n      // L2. Test x == 1.\n      while (x != 1)\n      {\n         i = i + 1;\n         if (i > 50) break;\n         System.out.println(i + ", " + k + ", " +\n            x + ", " + y + ", " + z);\n\n         // L3.  Compare\n         if ((x - z) >= 1)\n         {\n            // L4. Reduce values *)\n            x = x - z;\n            z = shiftRight(x, k);\n            y = y + logTable(k);\n         }\n         else\n         {\n            // L5. Shift\n            z = shiftRight(z, 1);\n            k = k + 1;\n         }\n      }\n\n      System.out.println("result = " + binary2double(y));\n      System.out.println("should = " + (Math.log(1.5) / Math.log(base)));\n   }\n}
New I always suspected C++ was about half as fast as C
But I never benched it. It just "felt" a lot slower than it ought to despite the fanatical devotion to efficient navel gazing of its proponents.

I wish they'd benched Squeak. I do know Squeak is about 10x faster than Ruby. Probably about as fast as Python seems to be (a little slower than VisualWorks).




[link|http://www.blackbagops.net|Black Bag Operations Log]

[link|http://www.objectiveclips.com|Artificial Intelligence]

[link|http://www.badpage.info/seaside/html|Scrutinizer]
New Bad architecture is bad architecture
Build the same app using EJB with entity beans and see how it stacks up (it'll probably be worse).

FWIW, my employer's site is built using C++ muscle with Perl brains and lots of custom code optimized for the use case.

OTOH, spinoffs, like 43Things, are all being built using Ruby on Rails. Its working well enough for them.

If you need it soon - use a high level scripting language. If you need it to be fast, write the slow parts in C.

Nothing new there.

I eschew Java because it doesn't work well with anything else and takes about as much effort to write as C. IOW, you can't write a library in Java and call it from another language without incurring huge efficiency costs.



[link|http://www.blackbagops.net|Black Bag Operations Log]

[link|http://www.objectiveclips.com|Artificial Intelligence]

[link|http://www.badpage.info/seaside/html|Scrutinizer]
New Dynamic + low level seems like a good combo
I basically did that with an older project - used Python for higher level customizations and to allow run time loadable modules. This made it very easy to handle customer requests for, example, the data to go different places.

The lower levels were in VB (GUI) and C++, and for our custom board (which has hard real time requirements) C (for the DSP) and Verilog (for the FPGA).

Overall, the idea has worked extremely well, and allowed the system to handle new requirements pretty well.

It gets even more interesting for embedded systems. I think there is a lot of room for improved developer productivity in embedded systems (including factory automation). But limited resources and real time requirements make it much more difficult than for a PC.

One possiblity is the combination of a compact dynamic language (such as Lua) with a compiled language such as C. Since gcc is widely available, two other compiled alternatives are Java and Objective-C (much more interesting to me).

An example is the [link|http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MCF52234&nodeId=0162468rH3YTLC00M98090|Freescale MCF52234 Microcontroller] which is basically a complete network engine on a chip - 60MHz CPU, 32K SRAM, 256K flash, Ethernet MAC and PHY (first for a 32-bit chip) for something like $15. But there's no expansion bus, all of your code has to fit in 256K (the only expansion possibilities are serial, which would be exteremely slow).

--Tony
New Interesting.
I just today found [link|http://www.whitebeam.org/|http://www.whitebeam.org/] which uses SpiderMonkey to provide a Server-Side JavaScript environment.

And I know Icon's runtime engine could use with some optimization work, although I was a little surprised it was even in the list, to be honest.

Wade.
"Insert crowbar. Apply force."
New Speaking of spider monkey
Good eatin'


Then there's the way Yamamoto obtained spider monkeys and sea lions.

"The Phoenix zoo have lot of monkey," shrugs Yamamoto. "Sometime they lose one. Maybe they think it escape. Maybe they should pay their employee better. For guard on night shift, $500 is lot of money. Same for sea lion at SeaWorld. If sea lion not perform in show, sea lion go bye-bye."


[link|http://phoenixnewtimes.com/Issues/2006-05-11/news/feature_full.html|http://phoenixnewtim...feature_full.html]
New The thing that really surprises me...
is that it is hosted on Alioth, Debian's gforge.

But after I thought a while about it, I came to the conclusion that it was the only place it could be hosted.

Alioth is for experimental development and research. Some projects there are to feed the SID, some are to change the way things in Debian are done, some are just plain ole "its better here because elsewhere it wouldn't get a fair bite".

But, the shootout is definitely an interesting project. I am surprisingly very interested in it.
--
[link|mailto:greg@gregfolkert.net|greg],
[link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwethey
Freedom is not FREE.
Yeah, but 10s of Trillions of US Dollars?
SELECT * FROM scog WHERE ethics > 0;

0 rows returned.
     It's flame war time! - (admin) - (8)
         I've been toying with a similar idea - (ChrisR) - (1)
             And while I'm on the subject... - (ChrisR)
         I always suspected C++ was about half as fast as C - (tuberculosis)
         Bad architecture is bad architecture - (tuberculosis) - (1)
             Dynamic + low level seems like a good combo - (tonytib)
         Interesting. - (static) - (1)
             Speaking of spider monkey - (broomberg)
         The thing that really surprises me... - (folkert)

Who are you, who are so wise in the ways of science?
131 ms