From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7d2c8b4487ef2145 X-Google-Attributes: gid103376,public From: "Jonas Nygren" Subject: Ada versus Java - Tasking Date: 1997/01/16 Message-ID: <01bc03ee$594dc520$829d6482@joy.ericsson.se>#1/1 X-Deja-AN: 210279024 organization: Ericsson newsgroups: comp.lang.ada Date: 1997-01-16T00:00:00+00:00 List-Id: I have written a small producer-consumer type of program both in Ada and Java. To my astonishment the Java code executes faster than the Ada code. My test starts 50 producer-consumer pairs that run in parallell. Each pair produces/consumes 1000 messages of 50 bytes. I get the following timing on my P133, 16M, and running Win95: Ada (Gnat 3.04a) : ~30 s Java (MS SDK-Java) : ~15 s This result was very much to my surprise! I have tried to check over and over and I can not find any errors in my code. Furthermore, with Java I managed to start 400 producer-consumer pairs but the Ada version stopped working already when 63 pairs were started (62 pairs would run). What is a reasonable explanation to this result. Both Gnat and Java run on top of Win95's threads so there must be something else that differs. It might be that Gnat 3.04a is a bit dated and that the implementation in Win95 isn't so good. It could also be that Ada tasking is inherently 'heavier' than Java's and that this accounts for the differences. I would be interested to understand this better if you have any idea what is happening here. /jonas