From d894f23d893ee2fa05c34f02231e5c46563dc312 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sun, 8 Feb 2015 17:38:24 -0500 Subject: benchmark --- README.md | 10 ++++++++++ kernel/main.c | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f1b2c0..57ac2b5 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,13 @@ A little kernel licensed under the GPLv2. This kernel draws some code from [gamma](https://github.com/theunamedguy/gamma), and can be considered its successor. + +# Graphics Benchmark Results + +QEMU @ 640x480x32: + 1,000,000 pixels: .45 seconds + 1,000 fills: 1.92 seconds + 1,000,000 chars: 1.11 seconds + 1,000,000 hlines: 1.66 seconds + 1,000,000 vlines: 3.39 seconds + 10,000 rects: 1.24 seconds diff --git a/kernel/main.c b/kernel/main.c index 211be18..787a471 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -116,8 +116,10 @@ void main(struct multiboot_info_t *hdr, uint32_t magic) } int endvline = *current_tick; + gfx_clear(); + int startrect = *current_tick; - for(int i=0;i<1000;++i) + for(int i=0;i<10000;++i) { int x = rand() % *gfx_width; int y = rand() % *gfx_height; @@ -134,7 +136,7 @@ void main(struct multiboot_info_t *hdr, uint32_t magic) printf("Ticks for 1,000,000 random chars: %d\n", endtext-starttext); printf("Ticks for 1,000,000 random hlines: %d\n", endhline-starthline); printf("Ticks for 1,000,000 random vlines: %d\n", endvline-startvline); - printf("Ticks for 1,000 random rects: %d\n", endrect-startrect); + printf("Ticks for 10,000 random rects: %d\n", endrect-startrect); printf("Ticks per second: %d\n", HZ); printf("Resolution: %dx%dx%d\n", *gfx_width, *gfx_height, *gfx_bpp * 8); } -- cgit v1.1