亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.c

?? PB 熟悉的哥們希望大家可以互相學習一下
?? C
字號:
/*****************************************************************
 *                                                               *
 * Copyright (c) 2001-2007 McObject LLC. All Right Reserved.     *
 *                                                               *
 *****************************************************************/

/* This test allows to receive some results about the eXtremeDB performance
 * for all basic operations. This test inserts N objects into a class, creating
 * a hash index as it does insertions; then separatelly builds a tree index,
 * performs searches using a tree and a hash table, an a sequential search.
 * At last the tree is removed and all the object are deleted one-by-one.
 * Each Insetrtion and deletion done in a separate transaction, so the
 * commit time is included in the measurements.
 */

#include <platform.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#include <mcoHA.h>
#include "perf2.h"

/* Make sure you've got this 16M, otherwise you'll be measuring
 * the performance of your disk.
 */
#define DBSIZE      ( 1024 * 16000 )
#ifndef MCO_PLATFORM_X64
    #define PAGESIZE    128
#else 
    #define PAGESIZE    256
#endif 

const int MAP_ADDRESS = 0x20000000;

/* If you change the number of objects inserted, make sure that you
 * first have enough memory (DBSIZE), and also decalred hash table
 * size appropriatelly (hkey[estimated_numeber_of_entries] in perf2.mco
 */
const int nRecords = 100000;

void _SH_(void)
{

    char text[] = 
    {
        "\nThis test allows to receive some results about the eXtremeDB\n"
            "performance for all basic operations. This test inserts N objects\n"
            "into a class, creating a hash index as it does insertions; then\n"
            "separatelly builds a tree index,performs searches using a tree and\n"
            "a hash table, an a sequential search.At last the tree is removed\n"
            "and all the object are deleted one-by-one. Each insertion and deletion\n"
            "done in a separate transaction, so the commit time is included in the\n""measurements.\n"
    };
    char text1[] = 
    {
        "Copyright (c) 2001-2007 McObject LLC. All Right Reserved.\n\n"
    };

    printf("%s\neXtremeDB runtime version %d.%d, build %d\n%s\n\nPress Enter to start", text, MCO_COMP_VER_MAJOR,
           MCO_COMP_VER_MINOR, MCO_COMP_BUILD_NUM, text1);
    getchar();

}

static void errhandler(int n)
{
    printf("\neXtremeDB runtime fatal error: %d", n);
    getchar();
    exit( - 1);
}


int main(void)
{
    const char* dbName = "perf2";
    time_t start_time;
    MCO_RET rc;
    mco_db_h db = 0;
    mco_trans_h t;
    int i;
    long n = 0;
    Record rec;
    mco_cursor_t c;
    uint4 key = 1999;
    void* start_mem;
    mco_runtime_info_t info;

    _SH_();

    mco_get_runtime_info(&info);
    if (info.mco_shm_supported)
    {
        start_mem = (void*)MAP_ADDRESS;
    }
    else
    {
        start_mem = (void*)malloc(DBSIZE);
        if (!start_mem)
        {
            printf("Couldn't allocated memory\n");
            exit(1);
        }
    };

    mco_error_set_handler(&errhandler);

    rc = mco_runtime_start();
    rc = mco_db_open(dbName, perf2_get_dictionary(), start_mem, DBSIZE, (uint2)PAGESIZE);
    if (rc)
    {
        printf("\nerror %d creating database", rc);
        if (!info.mco_shm_supported)
        {
            free(start_mem);
        }
        exit(1);
    }

    /* connect to the database, obtain a database handle */
    mco_db_connect(dbName, &db);

    /* insert Records, don't create the tree index yet
     */

    printf("Insert ");
    Sleep(20);
    start_time = msec();
    for (i = 0; i < nRecords; i++)
    {
        key = (3141592621u* i + 2718281829u) % 1000000007u;
        rc = mco_trans_start(db, MCO_READ_WRITE, MCO_TRANS_FOREGROUND, &t);
        if (MCO_S_OK != rc)
        {
            exit(1);
        }
        rc = Record_new(t, &rec);
        Record_key_put(&rec, key);

        rc = mco_trans_commit(t);
        if (!rc)
        {
            n++;
        }
        if (i % (nRecords / 10) == 0)
        {
            printf(".");
        }

    }

    printf(" %d objects: %d milliseconds,(%d microsecs/object)\n", n, (int)(msec() - start_time), ((msec() - start_time)
           * 1000) / n);

    /* create the tree index */
    Sleep(20);
    rc = mco_trans_start(db, MCO_READ_WRITE, MCO_TRANS_FOREGROUND, &t);
    if (MCO_S_OK != rc)
    {
        if (!info.mco_shm_supported)
        {
            free(start_mem);
        }
        exit(1);
    };
    printf("Creating tree ...... ");
    start_time = msec();
    rc = Record_tkey_create(t);
    mco_trans_commit(t);

    if (rc == MCO_S_OK)
    {
        printf(" %d objects: %d milliseconds (%d microsecs/object)\n", nRecords, (int)(msec() - start_time), ((msec() -
               start_time)* 1000) / nRecords);
    }
    else
    {
        printf("Unable to create voluntary index. Error code %d\n", rc);
    };

    /* hash search */
    Sleep(20);
    rc = mco_trans_start(db, MCO_READ_ONLY, MCO_TRANS_FOREGROUND, &t);
    if (MCO_S_OK != rc)
    {
        if (!info.mco_shm_supported)
        {
            free(start_mem);
        }
        exit(1);
    };

    printf("Hash search ");
    start_time = msec();
    for (i = 0; i < nRecords; i++)
    {
        key = (3141592621u* i + 2718281829u) % 1000000007u;
        rc = Record_hkey_find(t, key, &rec);
        if (i % (nRecords / 10) == 0)
        {
            printf(".");
        }
    }
    printf("% d searches: %d milliseconds (%d microsecs/search)\n", nRecords, (int)(msec() - start_time), ((msec() -
           start_time)* 1000) / nRecords);

    mco_trans_commit(t);


    /* tree search */
    Sleep(20);
    printf("Tree search ");
    start_time = msec();

    rc = mco_trans_start(db, MCO_READ_ONLY, MCO_TRANS_FOREGROUND, &t);

    rc = Record_tkey_index_cursor(t, &c);

    if (rc == MCO_S_OK)
    {

        for (i = 0; i < nRecords; i++)
        {
            key = (3141592621u* i + 2718281829u) % 1000000007u;
            Record_tkey_search(t, &c, MCO_EQ, key);
            if (i % (nRecords / 10) == 0)
            {
                printf(".");
            }

        }

        printf(" %d searches: %d milliseconds (%d microsecs/search)\n", nRecords, (int)(msec() - start_time), ((msec() 
               - start_time)* 1000) / nRecords);
    }
    else
    {
        printf("Unable to open a cursor on voluntary index. Error code %d\n", rc);
    }
    mco_trans_commit(t);

    /* cursor movements */
    Sleep(20);
    printf("Sequential ");
    start_time = msec();
    rc = mco_trans_start(db, MCO_READ_ONLY, MCO_TRANS_FOREGROUND, &t);

    rc = Record_tkey_index_cursor(t, &c);

    if (rc == MCO_S_OK)
    {
        for (n = 0, rc = mco_cursor_first(t, &c); rc == MCO_S_OK; rc = mco_cursor_next(t, &c))
        {
            if (n % (nRecords / 10) == 0)
            {
                printf(".");
            }
            n++;
        }
        printf(" %d searches: %d milliseconds (%d microsecs/search)\n", n, (int)(msec() - start_time), ((msec() -
               start_time)* 1000) / n);
    }
    else
    {
        printf("Unable to open a cursor on voluntary index. Error code %d\n", rc);
    }
    mco_trans_commit(t);

    /* removing the tree */
    rc = mco_trans_start(db, MCO_READ_WRITE, MCO_TRANS_FOREGROUND, &t);
    if (MCO_S_OK != rc)
    {
        if (!info.mco_shm_supported)
        {
            free(start_mem);
        }
        exit(1);
    };

    printf("Removing the tree ...... ");
    start_time = msec();
    rc = Record_tkey_drop(t);
    mco_trans_commit(t);

    if (rc == MCO_S_OK)
    {
        printf(" %d milliseconds\n", (int)(msec() - start_time));
    }
    else
    {
        printf("Unable to drop a voluntary index. Error code %d\n", rc);
    }

    /* Search using hash index and remove the object ones found
     */
    printf("Search/delete ");

    start_time = msec();
    for (n = 0, i = 0; i < nRecords; i++)
    {
        key = (3141592621u* i + 2718281829u) % 1000000007u;
        rc = mco_trans_start(db, MCO_READ_WRITE, MCO_TRANS_FOREGROUND, &t);
        if (MCO_S_OK != rc)
        {
            exit(1);
        }

        rc = Record_hkey_find(t, key, &rec);

        if (rc == MCO_S_OK)
        {
            rc = Record_delete(&rec);
        }
        else
        {
            break;
        }

        rc = mco_trans_commit(t);
        if (!rc)
        {
            n++;
        }
        if (n % (nRecords / 10) == 0)
        {
            printf(".");
        }
    }
    printf(" %d objects: %d milliseconds (%d microsecs/object)\n", n, (int)(msec() - start_time), ((msec() - start_time)
           * 1000) / n);

    /* disconnect from the database, db is no longer valid */
    mco_db_disconnect(db);

    /* destroy the database */
    mco_db_close(dbName);
    mco_runtime_stop();

    if (!info.mco_shm_supported)
    {
        free(start_mem);
    }

    printf("\nPress Enter to exit");
    getchar();
    PROG_EXIT(0);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品中文字幕一区二区三区| 欧美片网站yy| 欧美性xxxxxxxx| 精品成人a区在线观看| 一区二区三区免费网站| 国产精品中文有码| 欧美一区二区三区在线看| 亚洲视频免费看| 国产suv一区二区三区88区| 欧美精选一区二区| 一区二区在线免费| 波波电影院一区二区三区| 精品国产亚洲一区二区三区在线观看| 亚洲国产一区在线观看| 91丨九色丨黑人外教| 中文字幕乱码一区二区免费| 久久精品国产999大香线蕉| 欧美人成免费网站| 一区二区三区不卡视频| 91麻豆国产自产在线观看| 国产欧美中文在线| 国产传媒一区在线| 国产欧美精品一区二区色综合| 奇米精品一区二区三区在线观看| 欧美日韩在线不卡| 午夜日韩在线电影| 欧美精品日韩精品| 蜜臀av一区二区在线免费观看 | 日韩美女天天操| 亚洲国产日韩一级| 欧美日韩免费观看一区二区三区| 中文字幕佐山爱一区二区免费| 国产精品系列在线观看| 日本一区二区视频在线观看| 成人一级片在线观看| 国产精品久久久一区麻豆最新章节| 从欧美一区二区三区| 国产精品乱人伦| 99精品久久免费看蜜臀剧情介绍| 亚洲三级电影全部在线观看高清| 91天堂素人约啪| 香港成人在线视频| 欧美草草影院在线视频| 国产真实乱对白精彩久久| 国产日产亚洲精品系列| 99久久国产综合色|国产精品| 亚洲老司机在线| 欧美日韩国产a| 久久9热精品视频| 国产精品美女久久久久久久 | 一区二区三区蜜桃| 9191久久久久久久久久久| 激情五月播播久久久精品| 中文字幕欧美日韩一区| 欧美在线不卡一区| 蜜臀av一级做a爰片久久| 国产欧美1区2区3区| 一本久久综合亚洲鲁鲁五月天| 午夜久久电影网| 国产清纯在线一区二区www| 在线免费观看日本欧美| 精品综合免费视频观看| 亚洲丝袜自拍清纯另类| 91精品国产综合久久蜜臀| 高清日韩电视剧大全免费| 亚洲一二三专区| 久久九九久精品国产免费直播| 99re这里都是精品| 久久国产精品第一页| 亚洲视频狠狠干| 日韩欧美一二区| 色琪琪一区二区三区亚洲区| 精品一区二区三区日韩| 亚洲一区二区三区视频在线| 久久免费美女视频| 欧美性感一区二区三区| 成人性生交大片免费看中文| 人人狠狠综合久久亚洲| 亚洲日本在线视频观看| 2020国产精品自拍| 欧美性xxxxxx少妇| 99热99精品| 国产精品一区二区三区网站| 午夜精品久久久久久久久久 | 亚洲成人激情av| 国产精品久久久久永久免费观看| 日韩一级大片在线| 欧美性猛交xxxx黑人交| 99精品久久99久久久久| 国产乱码精品1区2区3区| 日产国产高清一区二区三区| 亚洲精品欧美激情| 一区在线中文字幕| 欧美国产激情二区三区| 精品女同一区二区| 日韩三级电影网址| 51午夜精品国产| 欧美日韩国产首页| 在线观看日产精品| 91色porny| 色久综合一二码| 欧洲在线/亚洲| 一道本成人在线| 色天天综合久久久久综合片| 91在线播放网址| 91色婷婷久久久久合中文| 成人免费黄色在线| 成人午夜激情在线| jlzzjlzz亚洲日本少妇| 成人激情免费电影网址| 成人毛片老司机大片| 国产成人av电影在线播放| 国产高清精品在线| 国产mv日韩mv欧美| av中文字幕不卡| 91片在线免费观看| 在线中文字幕不卡| 欧美日韩久久久| 在线91免费看| 精品对白一区国产伦| 亚洲精品在线观看视频| 国产视频不卡一区| 亚洲欧美综合色| 亚洲一区二区综合| 喷水一区二区三区| 国产黑丝在线一区二区三区| 丁香婷婷综合网| 在线视频欧美区| 欧美精品自拍偷拍| 精品88久久久久88久久久| 日本一区二区三区dvd视频在线| 国产精品无圣光一区二区| 亚洲欧洲精品一区二区三区| 亚洲欧美色一区| 日韩影院精彩在线| 国产精品自拍一区| 91麻豆高清视频| 91精品午夜视频| 日本一区二区免费在线观看视频 | 麻豆高清免费国产一区| 国产一区高清在线| 91色婷婷久久久久合中文| 欧美日韩免费在线视频| 精品福利一二区| 一区二区三区免费看视频| 日本在线观看不卡视频| 成人av资源在线观看| 欧美这里有精品| 国产午夜精品一区二区三区四区| 伊人一区二区三区| 精品在线亚洲视频| 色婷婷久久一区二区三区麻豆| 制服.丝袜.亚洲.中文.综合| 久久久久99精品国产片| 亚洲综合在线免费观看| 国产在线播放一区三区四| 91免费在线视频观看| 精品国产成人在线影院 | 欧美专区在线观看一区| 久久奇米777| 亚洲成人免费观看| 高清视频一区二区| 日韩欧美国产一区在线观看| 国产精品久久久久久亚洲毛片| 视频一区国产视频| 91亚洲大成网污www| 国产欧美一区二区三区鸳鸯浴 | 久久99精品一区二区三区 | 成人精品视频.| 欧美一卡2卡三卡4卡5免费| 国产精品久久久久久久久久免费看 | 国产精品久久久久一区| 久久精品国产一区二区| 欧美吻胸吃奶大尺度电影| 中文字幕成人网| 国产乱子伦视频一区二区三区| 5月丁香婷婷综合| 亚洲国产一区二区a毛片| 色综合天天综合网国产成人综合天 | 久久精品欧美一区二区三区不卡| 午夜成人免费视频| 欧美私人免费视频| 一区二区三区高清| 色综合色狠狠综合色| 日本一区二区免费在线| 国产精品夜夜爽| 亚洲精品一区二区三区福利| 麻豆精品一区二区综合av| 欧美久久久一区| 日韩综合小视频| 69成人精品免费视频| 午夜日韩在线电影| 91精品国产入口| 久久精工是国产品牌吗| 日韩久久免费av| 精品在线亚洲视频| 久久综合成人精品亚洲另类欧美| 国产综合一区二区| 日本一区二区三区国色天香 | 综合精品久久久|