Skip to content

Commit

Permalink
MailboxTest now better throughput, slower response time, but no race …
Browse files Browse the repository at this point in the history
…conditions.
  • Loading branch information
laforge49 committed Feb 12, 2012
1 parent 61a9778 commit 251c042
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README
Expand Up @@ -89,8 +89,8 @@ Message Passing Benchmarks
When actors share the same mailbox, 1,095,890,410 messages are passed per second.
With a response time of 7.6 nanoseconds.

When different mailboxes are used, the rate drops to 71,095,312 per second and
the response time becomes 56 nanoseconds.
When different mailboxes are used, the rate drops to 76,099,881 per second and
the response time becomes 71 nanoseconds.

Asynchronous message passing is also supported, making it easy to use all the
available hardware threads for good vertical scalability. Messages sent to an
Expand Down
26 changes: 13 additions & 13 deletions src/test/java/org/agilewiki/jactor/lpc/timing/MailboxTest.java
Expand Up @@ -6,22 +6,22 @@

public class MailboxTest extends TestCase {
public void testTiming() {
int c = 2;
int b = 3;
int p = 1;
int t = 1;
//int c = 2;
//int b = 3;
//int p = 1;
//int t = 1;

//int c = 10000000;
//int b = 1;
//int p = 16;
//int t = 4;
int c = 10000000;
int b = 1;
int p = 16;
int t = 4;

//burst size of 1
//16 parallel runs of 20000000 messages each.
//320000000 messages sent with 4 threads.
//msgs per sec = 71095312
//14 nanoseconds per message test
//response time 56 namoseconds
//msgs per sec = 56248901
//18 nanoseconds per message test
//response time 71 namoseconds

//int c = 10000;
//int b = 1000;
Expand All @@ -31,8 +31,8 @@ public void testTiming() {
//burst size of 1000
//16 parallel runs of 20000000 messages each.
//320000000 messages sent with 4 threads.
//msgs per sec = 65093572
//15 nanoseconds per message
//msgs per sec = 76099881
//13 nanoseconds per message

MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(t);
try {
Expand Down
Expand Up @@ -123,7 +123,7 @@ public void test5() {
PrintResponse printResponse = new PrintResponse(new Hi(), a);
PrintParallelResponse printParallelResponse = new PrintParallelResponse(count, bs, printResponse);
int j = 0;
while (j < 1000) {
while (j < 1) {
printParallelResponse.send(future, c);
j += 1;
}
Expand Down

0 comments on commit 251c042

Please sign in to comment.