예제 #1
0
//-------------------------------------------------------------------
static void gui_bench_run() {
    long t;
    register int x;
    register unsigned int n, s;
    register int *buf;
    
    bench_to_draw = 2;

    bench.screen_output_bps = 0;
    gui_bench_draw();
    bench_screen_write();
    bench_to_draw = 1;
    
    bench.screen_input_bps = 0;
    gui_bench_draw();
    bench_screen_read();
    bench_to_draw = 2;

    buf = malloc(0x10000);
    if (buf) {
        bench.memory_write_bps = 0;
        gui_bench_draw();
        bench_mem_write(buf);
        bench_to_draw = 2;

        bench.memory_read_bps = 0;
        gui_bench_draw();
        bench_mem_read(buf);
        bench_to_draw = 2;
    }

    x = open("A/BENCH.TMP", O_WRONLY|O_CREAT, 0777);
    if (x>=0) {
        bench.disk_write_raw_bps = 0;
        gui_bench_draw();
        t = get_tick_count();
        s=write(x, hook_raw_image_addr(), camera_sensor.raw_size);
        t = get_tick_count() - t;
        close(x);
        bench.disk_write_raw_bps = s*100 / (t/10);
        bench_to_draw = 2;
    }

    x = open("A/BENCH.TMP", O_WRONLY|O_CREAT, 0777);
    if (x>=0) {
        bench.disk_write_mem_bps = 0;
        gui_bench_draw();
        t = get_tick_count();
        s=write(x, (void*)0x10000, 0xC00000);
        t = get_tick_count() - t;
        close(x);
        bench.disk_write_mem_bps = s*100 / (t/10);
        bench_to_draw = 2;
    }

    if (buf) {
        x = open("A/BENCH.TMP", O_WRONLY|O_CREAT, 0777);
        if (x>=0) {
            bench.disk_write_buf_bps = 0;
            gui_bench_draw();
            s = 0;
            t = get_tick_count();
            for (n=0; n<256; ++n)
                s+=write(x, buf, 0x10000);
            t = get_tick_count() - t;
            close(x);
            bench.disk_write_buf_bps = s*100 / (t/10);
            bench_to_draw = 2;
        }

        x = open("A/BENCH.TMP", O_RDONLY, 0777);
        if (x>=0) {
            bench.disk_read_buf_bps = 0;
            gui_bench_draw();
            s = 0;
            t = get_tick_count();
            for (n=0; n<256; ++n)
                s+=read(x, buf, 0x10000);
            t = get_tick_count() - t;
            close(x);
            bench.disk_read_buf_bps = s*100 / (t/10);
            bench_to_draw = 2;
        }
        free(buf);
    }
    remove("A/BENCH.TMP");
        
    gui_bench_draw();
}
예제 #2
0
파일: wrappers.c 프로젝트: emlyn/chdk
// for cameras with two (or more?) RAW buffers this can be used to speed up DNG creation by
// calling reverse_bytes_order only once. Override in platform/sub/lib.c
char __attribute__((weak)) *hook_alt_raw_image_addr() {
	return hook_raw_image_addr();
}