ImageVerifierCode 换一换
格式:DOCX , 页数:18 ,大小:314.40KB ,
资源ID:18697630      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/18697630.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(BerkeleyDB和eXtremeDB性能在LINUX下的比较Word格式文档下载.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

BerkeleyDB和eXtremeDB性能在LINUX下的比较Word格式文档下载.docx

1、 numitems = 0;FILE *fp;char*progname;void op_ds(u_int, int);void op_ds_bulk(u_int, u_int *);void op_tds(u_int, int, u_int32_t);void res(char *, u_int);voidres(char *msg, u_int ops)double elapsed;struct db_time v;v.secs = end_time.secs - start_time.secs;v.usecs = end_time.usecs - start_time.usecs;if

2、(start_time.usecs end_time.usecs) v.secs-;v.usecs += 1000000;elapsed = v.secs + v.usecs / 1e6;printf(%sntelapsed time: %f seconds : %g key/data pairs per secn, msg, elapsed, ops / elapsed);op_ds(u_int ops, int update)char *letters = abcdefghijklmnopqrstuvwxuz;DB *dbp;DBT key, data;char *keybuf, *dat

3、abuf;DB_MPOOL_STAT *gsp;(void)remove(a);assert(keybuf = malloc(keysize) != NULL);assert(databuf = malloc(datasize) !memset(&key, 0, sizeof(key);data, 0, sizeof(data);key.data = keybuf;key.size = keysize;memset(keybuf, a, keysize);data.data = databuf;data.size = datasize;memset(databuf, b, datasize);

4、assert(db_create(&dbp, NULL, 0) = 0);dbp-set_errfile(dbp, stderr);assert(dbp-set_pagesize(dbp, pagesize) = 0);open(dbp, NULL, NULL, NULL, DB_BTREE, DB_CREATE, 0666) = 0);dbenv-memp_stat(dbp-dbenv, &gsp, NULL, DB_STAT_CLEAR);if (update) _os_clock(NULL, &start_time.secs, &start_time.usecs);for (; ops

5、0; -ops) keybuf(ops % keysize) = letters(ops % 26);put(dbp, NULL, &key, &data, 0) = 0);end_time.secs, &end_time.usecs); else -ops)get(dbp, NULL, &gsp, NULL, 0);assert(gsp-st_cache_miss = 0);close(dbp, 0) = 0);op_ds_bulk(u_int ops, u_int *totalp)DBC *dbc;u_int32_t len, klen;u_int i, total;void *point

6、er, *dp, *kp;assert(databuf = malloc(bulkbufsize) !set_cachesize(dbp, 0, cachesize, 1) = 0);for (i = 1; i set_msgfile(dbp, fp);assert (dbp-stat_print(dbp, DB_STAT_ALL) = 0);cursor(dbp, NULL, &dbc, 0) = 0);data.ulen = bulkbufsize;data.flags = DB_DBT_USERMEM;if (ops 10000)ops = 10000;for (total = 0;as

7、sert(dbc-c_get( dbc, &data, DB_FIRST | DB_MULTIPLE_KEY) = 0);DB_MULTIPLE_INIT(pointer, &data);while (pointer != NULL) DB_MULTIPLE_KEY_NEXT(pointer, &data, kp, klen, dp, len);if (kp != NULL)+total;*totalp = total;/*assert(dbp-*/op_tds(u_int ops, int update, u_int32_t txn_flags)DB_ENV *dbenv;DB_TXN *t

8、xn;#ifndef _WIN32(void)system(rm -rf TESTDIR; mkdir TESTDIRassert(db_env_create(&dbenv, 0) = 0);set_errfile(dbenv, stderr);assert(dbenv-set_flags(dbenv, DB_AUTO_COMMIT | txn_flags, 1) = 0);set_lg_bsize(dbenv, logbufsize) = 0);open(dbenv, TESTDIR DB_CREATE | DB_PRIVATE | DB_INIT_LOCK | DB_INIT_LOG |

9、DB_INIT_MPOOL | DB_INIT_TXN, 0666) = 0);dbp, dbenv, 0) = 0);open(dbp, NULL, NULL, DB_BTREE, DB_CREATE, 0666) = 0);if (update) memp_stat(dbenv, & -ops)txn_begin(dbenv, NULL, &txn, 0) = 0);assert(txn-commit(txn, 0) = 0);st_page_out = 0);close(dbenv, 0) = 0);intmain(int argc, char *argv)extern char *op

10、targ;extern int optind;u_int ops, total;int ch;int major, minor, patch;if (progname = strrchr(argv0, /) = NULL)progname = argv0;else+progname;ops = 100000;while (ch = getopt(argc, argv, d:k:o:p:) != EOF)switch (ch) case d:datasize = (u_int)atoi(optarg);break;kkeysize = (u_int)atoi(optarg);oops = (u_

11、int)atoi(optarg);ppagesize = (u_int32_t)atoi(optarg);?default:usage();argc -= optind;argv += optind;numitems = (cachesize / (keysize + datasize - 1) / 2;db_version(&major, &minor, &patch);Using Berkeley DB %d.%d.%d - , major, minor, patch);ops: %u; keysize: %d; datasize: %dn, ops, keysize, datasize)

12、;op_ds(ops, 0); res(DS (read):, ops);if (keysize = 8) op_ds_bulk(ops, &total);res(DS (bulk read):, total);ntskipped: bulk get requires a key size = 10nop_ds(ops, 1);DS (write):op_tds(ops, 0, 0);TDS (read):op_tds(ops, 1, DB_LOG_INMEMORY);TDS (write, in-memory logging):op_tds(ops, 1, DB_TXN_NOSYNC);TD

13、S (write, no-sync on commit):op_tds(ops, 1, DB_TXN_WRITE_NOSYNC);TDS (write, write-no-sync on commit):op_tds(ops, 1, 0);TDS (write, sync on commit):return (EXIT_SUCCESS);usage()fprintf(stderr, usage: %s -d datasize -k keysize -o ops -p pagesizen progname);exit(1);2、eXtremeDB测试源程序:/* * Copyright (c)

14、2001-2006 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

15、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.platform.h/#include perf2.h/* Make sure youve got this 16M, otherwi

16、se youll be measuring* the performance of your disk.#define DBSIZE ( 1024 * 16000 )#define PAGESIZE 128const 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 (hkeyestimated_numeber_of_entries in perf2.mcoconst int nRecords = 100000;void _SH_(void) char text = nThis test allows to receive some results about the eXtremeDBnperformance

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1