资源简介
20170526154614428.Net程序突破内存2G访问限制的程序代码.zip
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
namespace AweSimple
{
class Program
{
static void TestSpeed()
{
try
{
byte[] inputBuffer = new byte[1024];
Stopwatch stopWatch = new Stopwatch();
using (AweStream.AweStream aweStream = new AweStream.AweStream(1024 * 1024 * 100))
{
//Map
aweStream.Map();
stopWatch.Start();
//Copy one bytes
//Use unsafe pointer
for (int i = 0; i < 1024 * 1024 * 100; i++)
{
unsafe
{
aweStream.LpMemory[i] = 1;
}
}
stopWatch.Stop();
Console.WriteLine(stopWatch.ElapsedMilliseconds);
aweStream.Position = 0;
//Block copy
stopWatch.Reset();
stopWatch.Start();
for (int i = 0; i < 1024 * 100; i++)
{
unsafe
{
aweStream.Write(inputBuffer 0 1024);
}
}
stopWatch.Stop();
Console.WriteLine(stopWatch.ElapsedMilliseconds);
//UnMap
aweStream.UnMap();
}
byte[] ManageBuf = new byte[1024 * 1024 * 100];
stopWatch.Reset();
stopWatch.Start();
for (int i = 0; i < 1024 * 1024 * 100; i++)
{
ManageBuf[i] = 1;
}
stopWatch.Stop();
Console.WriteLine(stopWatch.ElapsedMilliseconds);
stopWatch.Reset();
stopWatch.Start();
for (int i = 0; i < 1024 * 100; i++)
{
Array.Copy(inputBuffer 0 ManageBuf i * 1024 1024);
}
stopWatch.Stop();
Console.WriteLine(stopWatch.ElapsedMilliseconds);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
Console.WriteLine(e.StackTrace);
}
}
static void Main(string[] args)
{
TestSpeed();
string input = Console.ReadLine();
List aweStreams = new List();
while (true)
{
switch (input)
{
case “a“:
try
{
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2008-11-06 17:03 AweSimple\
文件 2265 2008-11-04 17:49 AweSimple\AweSimple.csproj
文件 5361 2008-11-06 16:45 AweSimple\Program.cs
目录 0 2008-11-04 18:05 AweSimple\Properties\
文件 1298 2008-11-04 18:05 AweSimple\Properties\AssemblyInfo.cs
目录 0 2008-11-06 17:03 AweStream\
文件 11105 2008-11-06 15:46 AweStream\AweStream.cs
文件 2449 2008-11-06 15:20 AweStream\AweStream.csproj
文件 692 2008-11-04 17:38 AweStream\AweStreamException.cs
目录 0 2008-11-04 18:05 AweStream\Properties\
文件 1421 2008-11-04 18:05 AweStream\Properties\AssemblyInfo.cs
目录 0 2008-11-06 15:20 AweStream\Win32\
文件 2748 2008-11-06 15:20 AweStream\Win32\AweApi.cs
文件 1686 2008-11-06 15:20 AweStream\Win32\Buffer.cs
文件 2208 2008-11-06 15:20 AweStream\Win32\General.cs
文件 5009 2008-11-06 15:20 AweStream\Win32\LoggedSetLockPagesPrivilege.cs
文件 551 2008-11-06 15:18 AweStream\Win32\LoggedSetLockPagesPrivilegeException.cs
文件 1397 2008-11-04 12:15 AweSimple.sln
文件 35328 2008-11-06 17:02 AweSimple.suo
- 上一篇:Web版流程图设计器WorkFlowBS
- 下一篇:labview实现图像分类
相关资源
- 2014-Verbal(SHL)大汇总(60道)更新至
- ESXivCenter安装镜像提取码.txt
- 靶机搭建7套.txt
- 解密密码.txt
- DevExpress.Localization.v10.2.3(汉化_来自
- 直流电机控制.zip
- PC与MCU通讯.zip
- 火车售票系统.zip
- 单片机教学打铃控制器.rar
- 老赵讲C.txt
- 448421COMP86.rar
- encmkh.rar
- 尚硅谷springboot视频.txt
- (IDMAllProductsKeygenv3.6)keygen.rar
- 梯度锐化的方法----微分法;图像边缘
- 时钟.c
- 基于Web的资源共享网站的设计与实现
- 软考BD云链接.txt
- dpc.slx
- zencart文件类型分布图.pdf
- xJPG.rar
- LDPC.zip
- 浅层神经网络工具函数.zip
- muleesb.txt
- VisualScope.rar
- 918+的MAC和SN码.docx
- C读取txt数据.rar
- 创想工作室_虚拟机安装方法及步骤
- good--各类udf模版.pdf
- 学生选课系统PPT答辩论文
评论
共有 条评论