小于等于k的素数个数的问题的测试源代码

时间:2012-11-22 07:39:31
【文件属性】:

文件名称:小于等于k的素数个数的问题的测试源代码

文件大小:412KB

文件格式:RAR

更新时间:2012-11-22 07:39:31

素数 源代码

小于等于k的素数个数的问题的测试源代码 测试大数据量时, 内存频繁分配所消耗的时间占非常大的比例, 使用大内存优化后的测试结果: -------------------------------------------------------------------------------- 11:34:52.796 -> begin CalcPrimeCount(100000000) 11:40:49.687 -> end CalcPrimeCount(100000000) {return: 5761455, used-ticks: 356890} -------------------------------------------------------------------------------- 11:40:49.687 -> begin CalcPrimeCount(200000000) 11:50:09.375 -> end CalcPrimeCount(200000000) {return: 11078937, used-ticks: 559688} -------------------------------------------------------------------------------- 11:50:09.375 -> begin CalcPrimeCount(10000) 11:50:09.375 -> end CalcPrimeCount(10000) {return: 1229, used-ticks: 0} -------------------------------------------------------------------------------- 11:50:09.375 -> begin CalcPrimeCount(65536) 11:50:09.375 -> end CalcPrimeCount(65536) {return: 6542, used-ticks: 0} -------------------------------------------------------------------------------- 11:50:09.375 -> begin CalcPrimeCount(100000) 11:50:09.375 -> end CalcPrimeCount(100000) {return: 9592, used-ticks: 0} -------------------------------------------------------------------------------- 11:50:09.375 -> begin CalcPrimeCount(500000) 11:50:09.375 -> end CalcPrimeCount(500000) {return: 41538, used-ticks: 0} -------------------------------------------------------------------------------- 11:50:09.375 -> begin CalcPrimeCount(1000000) 11:50:09.375 -> end CalcPrimeCount(1000000) {return: 78498, used-ticks: 0} -------------------------------------------------------------------------------- 11:50:09.375 -> begin CalcPrimeCount(5000000) 11:50:09.375 -> end CalcPrimeCount(5000000) {return: 348513, used-ticks: 0} -------------------------------------------------------------------------------- 11:50:09.375 -> begin CalcPrimeCount(10000000) 11:50:09.375 -> end CalcPrimeCount(10000000) {return: 664579, used-ticks: 0} -------------------------------------------------------------------------------- 11:50:09.375 -> begin CalcPrimeCount(50000000) 11:50:09.375 -> end CalcPrimeCount(50000000) {return: 3001134, used-ticks: 0} -------------------------------------------------------------------------------- 11:50:09.375 -> begin CalcPrimeCount(130000000) 11:50:09.375 -> end CalcPrimeCount(130000000) {return: 7378187, used-ticks: 0} -------------------------------------------------------------------------------- 11:50:09.375 -> begin CalcPrimeCount(150000000) 11:50:09.375 -> end CalcPrimeCount(150000000) {return: 8444396, used-ticks: 0} -------------------------------------------------------------------------------- 11:50:09.375 -> begin CalcPrimeCount(160000000) 11:50:09.375 -> end CalcPrimeCount(160000000) {return: 8974458, used-ticks: 0} -------------------------------------------------------------------------------- 11:50:09.375 -> begin CalcPrimeCount(190000000) 11:50:09.375 -> end CalcPrimeCount(190000000) {return: 10555473, used-ticks: 0} -------------------------------------------------------------------------------- 11:50:09.375 -> begin CalcPrimeCount(180000000) 11:50:09.375 -> end CalcPrimeCount(180000000) {return: 10030385, used-ticks: 0} --------------------------------------------------------------------------------


【文件预览】:
11.01-TestPrimes
----TestPrimes.opt(49KB)
----TestPrimes.plg(1KB)
----TestPrimes.dsp(4KB)
----Unit_KYLib()
--------KYTimer.h(2KB)
--------KYLib.h(1KB)
--------KYDebug.h(1KB)
--------KYThread.h(3KB)
--------KYTCPObj.h(5KB)
--------KYDebugObj.h(2KB)
--------KYIniFiles.h(6KB)
--------KYMemBlock.h(8KB)
--------KYQueueFile.h(4KB)
--------KYFileUtils.h(17KB)
--------KYFields.h(11KB)
--------KYFiles.h(4KB)
--------TCPSendThreads.h(3KB)
--------KYList.h(18KB)
--------KYAsynchRun.h(3KB)
--------KYVarType.h(7KB)
--------KYTable.h(19KB)
--------KYRunThreads.h(12KB)
--------KYQueueMap.h(3KB)
--------KYAVLTree.h(9KB)
--------KYDateTime.h(20KB)
--------KYCallFunc.h(6KB)
--------KYSeqObj.h(5KB)
--------KYRecvBuffer.h(2KB)
--------KYMapMem.h(711B)
--------KYHandles.h(3KB)
--------KYObject.h(3KB)
--------KYLevelTree.h(6KB)
--------KYLogObjs.h(6KB)
--------KYUDPObj.h(6KB)
--------ThreadObjs.h(1KB)
--------KYSyncObj.h(3KB)
--------KYString.h(18KB)
--------KYSockObj.h(18KB)
--------UDPSendThreads.h(3KB)
--------KYCodeUtils.h(3KB)
--------KYScanUtils.h(6KB)
----KYLib.lib(1.38MB)
----TestPrimes.dsw(545B)
----Release()
--------TestPrimes.obj(31KB)
--------TestPrimes.ini(314B)
--------TestPrimes_02.txt(3KB)
--------TestPrimes_04.txt(3KB)
--------TestPrimes.exe(116KB)
--------TestPrimes_03.txt(3KB)
--------TestPrimes_01.txt(2KB)
----TestPrimes.cpp(5KB)

网友评论