Skip to content

Commit

Permalink
Update benchmark results.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelpatel committed Feb 14, 2016
1 parent 8b6b310 commit ef6e56e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 44 deletions.
30 changes: 15 additions & 15 deletions examples/SchedulerBenchmark/SchedulerBenchmark.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,35 @@
* SchedulerBenchmark: started
* 1. Initiate scheduler and main task: 4 us
* 2. Yield main task: 11.00 us
* 3. Start a task: 16 us
* 3. Start a task: 20 us
* 4. Yield between two tasks: 22.89 us
* 5. Delay 10 ms and check increments: 10028:381, 26.32 us
* 6. Start 8 tasks: 140:8, 17.50 us
* 6. Start 8 tasks: 148:8, 18.50 us
* 7. Yield and check increments: 120:9, 13.33 us
* 8. Delay 10 ms and check increments: 10084:747, 13.50 us
* 8. Delay 10 ms and check increments: 10088:747, 13.50 us
*
* @section Results Arduino 1.6.7, Arduino Mega 2560
* SchedulerBenchmark: started
* 1. Initiate scheduler and main task: 4 us
* 2. Yield main task: 12.64 us
* 3. Start a task: 20 us
* 3. Start a task: 24 us
* 4. Yield between two tasks: 26.16 us
* 5. Delay 10 ms and check increments: 10028:338, 29.67 us
* 6. Start 47 tasks: 824:47, 17.53 us
* 7. Yield and check increments: 660:48, 13.75 us
* 8. Delay 10 ms and check increments: 10656:768, 13.88 us
* 6. Start 46 tasks: 860:46, 18.70 us
* 7. Yield and check increments: 648:47, 13.79 us
* 8. Delay 10 ms and check increments: 10436:752, 13.88 us
*
* @section Results Arduino 1.6.7, Arduino Due
* SchedulerBenchmark: started
* 1. Initiate scheduler and main task: 1 us
* 2. Yield main task: 1.36 us
* 3. Start a task: 4 us
* 4. Yield between two tasks: 2.92 us
* 5. Delay 10 ms and check increments: 9711:3133, 3.10 us
* 1. Initiate scheduler and main task: 2 us
* 2. Yield main task: 1.30 us
* 3. Start a task: 3 us
* 4. Yield between two tasks: 2.80 us
* 5. Delay 10 ms and check increments: 9497:3186, 2.98 us
* 6. Start 51 tasks: 112:51, 2.20 us
* 7. Yield and check increments: 81:52, 1.56 us
* 8. Delay 10 ms and check increments: 9939:6292, 1.58 us
* 7. Yield and check increments: 78:52, 1.50 us
* 8. Delay 10 ms and check increments: 9874:6500, 1.52 us
*
* @section Results Arduino 1.6.7, Teensy 3.1 (72 MHz)
* SchedulerBenchmark: started
* 1. Initiate scheduler and main task: 1 us
Expand Down
20 changes: 10 additions & 10 deletions examples/SchedulerBenchmarkChannel/SchedulerBenchmarkChannel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@
* Benchmark Scheduler Channel.
*
* @section Results Arduino 1.6.7
* Messages per second (send/recv).
* Arduino Pro-Mini 24328 (41.10 us)
* Arduino Mega 2560 21704 (46.07 us)
* Arduino Due 168344 (5.94 us)
* Messages per second (send/recv). PAYLOAD 1, 8
* Arduino Pro-Mini 23921 (41.80 us), 22002 (45.45 us)
* Arduino Mega 2560 21379 (46.77 us), 19834 (50.41 us)
* Arduino Due 165322 (6.05 us), 160893 (6.22 us)
*/

#include <Scheduler.h>
#include <Scheduler/Channel.h>

const size_t PAYLOAD_MAX = 1;
// const size_t PAYLOAD_MAX = 1;
const size_t PAYLOAD_MAX = 8;
struct msg_t {
int payload[PAYLOAD_MAX];
uint8_t payload[PAYLOAD_MAX];
};

Channel chan;
Expand All @@ -51,11 +52,10 @@ void loop()
{
unsigned long start = millis();
await(millis() - start >= 1000);
Serial.print(millis());
Serial.print(F(":loop::count="));
Serial.print(count);
Serial.print(F(", us="));
Serial.println(1000000.0 / count);
Serial.print(F(" ("));
Serial.print(1000000.0 / count);
Serial.println(F(" us)"));
Serial.flush();
count = 0;
}
Expand Down
20 changes: 9 additions & 11 deletions examples/SchedulerBenchmarkQueue/SchedulerBenchmarkQueue.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@
* Benchmark Scheduler Queue.
*
* @section Results Arduino 1.6.7
* Events per second (push/pull).
* Board\QUEUE_MAX 2, 8
* Arduino Pro-Mini 24033 (41.61 us), 92652 (10.79 us)
* Arduino Mega 2560 21470 (46.58 us), 86940 (11.50 us)
* Arduino Due 178364 (5.61 us), 667499 (1.50 us)
* Teensy 3.1 (72 MHz) 251880 (3.97 us), 973938 (1.03 us)
* Events per second (push/pull). QUEUE_MAX 2, 8
* Arduino Pro-Mini 24029 (41.62 us), 92638 (10.79 us)
* Arduino Mega 2560 21466 (46.59 us), 86919 (11.50 us)
* Arduino Due 183411 (5.45 us), 677502 (1.48 us)
*/

#include <Scheduler.h>
#include <Scheduler/Queue.h>

const unsigned int QUEUE_MAX = 2;
// const unsigned int QUEUE_MAX = 2;
const unsigned int QUEUE_MAX = 8;
typedef int event_t;
Queue<event_t, QUEUE_MAX> queue;
unsigned long count = 0;
Expand All @@ -50,11 +49,10 @@ void loop()
{
unsigned long start = millis();
await(millis() - start >= 1000);
Serial.print(millis());
Serial.print(F(":loop::count="));
Serial.print(count);
Serial.print(F(", us="));
Serial.println(1000000.0 / count);
Serial.print(F(" ("));
Serial.print(1000000.0 / count);
Serial.println(F(" us)"));
Serial.flush();
count = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
*
* @section Results Arduino 1.6.7
* Semaphore wait/signal per seconds.
* Arduino Pro-Mini 26319 (38 us)
* Arduino Mega 2560 23293 (43 us)
* Arduino Due 210090 (4.76 us)
* Teensy 3.1 (72 MHz) 277145 (3.61 us)
* Arduino Pro-Mini 26337 (37.97 us)
* Arduino Mega 2560 23289 (42.94 us)
* Arduino Due 196770 (5.08 us)
*/

#include <Scheduler.h>
Expand All @@ -47,11 +46,10 @@ void loop()
{
unsigned long start = millis();
await(millis() - start >= 1000);
Serial.print(millis());
Serial.print(F(":loop::count="));
Serial.print(count);
Serial.print(F(", us="));
Serial.println(1000000.0 / count);
Serial.print(F(" ("));
Serial.print(1000000.0 / count);
Serial.println(F(" us)"));
Serial.flush();
count = 0;
}
Expand Down

0 comments on commit ef6e56e

Please sign in to comment.