我有以下问题:
写时间到std::array用于int8,int16,int32和int64与每个尺寸增加一倍.我可以理解8位CPU的这种行为,但不能理解32/64位.
为什么32位系统需要4倍的时间来保存32位值而不是保存8位值?
这是我的测试代码:
#include <iostream>
#include <array>
#include <chrono>
std::array<std::int8_t, 64 * 1024 * 1024> int8Array;
std::array<std::int16_t, 64 * 1024 * 1024> int16Array;
std::array<std::int32_t, 64 * 1024 * 1024> int32Array;
std::array<std::int64_t, 64 * 1024 * 1024> int64Array;
void PutZero()
{
auto point1 = std::chrono::high_resolution_clock::now();
for (auto &v : int8Array) v = 0;
auto point2 = std::chrono::high_resolution_clock::now();
for (auto &v : int16Array) v = 0;
auto point3 = std::chrono::high_resolution_clock::now();
for …Run Code Online (Sandbox Code Playgroud) 我正在尝试在VS 2012(.NET 4.5)下创建C#app,使用由EntityFramework 6.0管理的SqLite(也试用了5.0).
我的步骤如下:
从http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki安装sqlite-netFx45-setup-bundle-x86-2012-1.0.85.0.exe
它为VS2012安装组件
创建C#项目
使用一个表创建简单的Sqlite DB,DDL遵循以下内容:
CREATE TABLE MyTable (
Id INT PRIMARY KEY,
Name1 TEXT,
Name2 VARCHAR,
Blob1 BLOB,
Date1 DATE,
Date2 DATETIME
);
Run Code Online (Sandbox Code Playgroud)现在应该生成代码,但我没有以下消息:
目标.NET Framework版本当前不支持数据类型"longchar"; 表'main.MyTable'中的列'Name1'被排除在外
目标.NET Framework版本当前不支持数据类型"二进制"; 表'main.MyTable'中的"Blob1"列被排除在外.
目标.NET Framework版本当前不支持数据类型"date"; 表'main.MyTable'中的"Date1"列被排除在外.
目标.NET Framework版本当前不支持数据类型"date"; 表'main.MyTable'中的'Date2'列被排除在外.
我对此感到非常惊讶,因为我已经使用EF + Sqlite,但使用其他提供程序(遗留1.0.66.0),我没有类型映射问题.
你在提到的Sqlite版本中遇到过类似的问题吗?你知道一些解决这个问题的方法吗?
最好的祝福.