< 返回版块

长琴 发表于 2021-11-07 22:40

Tags:rust,日报

rsqlite3:Rust重写sqlite3

使用示例:

$ cargo +nightly build --release
$ ./target/release/rsqlite3

sqlite> .open rrrrrruuuuuust.db
sqlite> CREATE TABLE opinions(x);
sqlite> insert into opinions(x) values (hex(randomblob(16)));
sqlite> insert into opinions(x) values (hex(randomblob(16)));
sqlite> insert into opinions(x) values (hex(randomblob(16)));
sqlite> insert into opinions(x) values (hex(randomblob(16)));
sqlite> select * from opinions;
x
--------------------------------
343D4BE24D07A96F8550B0942F664A6C
D6289536E4A8057EB44754358EACD31A
B4CA8E714CB57B11E7336263D214F30F
A6491CA289ABF90EB2D76F5E1F919272

GitHub:https://github.com/epilys/rsqlite3

Meadowlark:开源数字音频工作站

Meadowlark 由音乐家制作,供音乐家使用,是适用于 Linux、Mac 和 Windows 的免费开源 DAW(数字音频工作站)。它旨在为世界各地的艺术家提供易于使用且功能强大的录音、作曲、编辑、声音设计、混音和母带制作工具,同时还具有直观性和可定制性。

目前还处于开发阶段,设计图:

GitHub:https://github.com/MeadowlarkDAW/Meadowlark

keyscope:密钥工具

Mac 安装:

$ brew tap spectralops/tap && brew install keyscope

使用例子:

# 使用方法
$ keyscope validate PROVIDER -p PARAM1 PARAM2 .. PARAM_N

# 验证密钥
$ keyscope validate github $GITHUB_TOKEN

# 支持的密钥提供者
$ keyscope validate --providers

# 需要哪些参数
$ keyscope validate github --requirements

GitHub:https://github.com/SpectralOps/keyscope

trycmd:CLI测试用例工具

使用:

#[test]
fn ui() {
    let t = trycmd::TestCases::new();
    t.pass("tests/cmd/*.toml");
}

文档:https://docs.rs/trycmd/0.2.1/trycmd/

GitHub:https://github.com/assert-rs/trycmd

dlm:简单HTTP下载管理器

使用方法:

$ ./dlm --inputFile ~/dlm/links.txt --outputDir ~/dlm/output --maxConcurrentDownloads 2
OPTIONS:
    -i, --inputFile <inputFile>                              input file with links
    -M, --maxConcurrentDownloads <maxConcurrentDownloads>    used to limit the number of downloads in flight
    -o, --outputDir <outputDir>                              output directory for downloads

GitHub:https://github.com/agourlay/dlm

gpgpu-rs:基于wgpu的GPU计算库

向量 A B 相乘并将结果存入 C 的例子:

 use gpgpu::*;

 fn main() -> GpuResult<()> {
    let fw = Framework::default();
    
    // Original CPU data
    let cpu_data = (0..10000).into_iter().collect::<Vec<u32>>();

    // GPU buffer creation
    let buf_a = GpuBuffer::from_slice(&fw, &cpu_data);       // Input
    let buf_b = GpuBuffer::from_slice(&fw, &cpu_data);       // Input
    let buf_c = GpuBuffer::<u32>::new(&fw, cpu_data.len());  // Output

    // Shader load from SPIR-V binary file
    let shader_module = utils::shader::from_spirv_file(&fw, "<SPIR-V shader path>")?;
    //  or from a WGSL source file
    let shader_module = utils::shader::from_wgsl_file(&fw, "<WGSL shader path>")?;    

    // Descriptor set creation
    let desc_set = DescriptorSet::default()
        .bind_buffer(&buf_a, GpuBufferUsage::ReadOnly)
        .bind_buffer(&buf_b, GpuBufferUsage::ReadOnly)
        .bind_buffer(&buf_c, GpuBufferUsage::ReadWrite);
    
    // Kernel creation and enqueuing
    fw.create_kernel_builder(&shader_module, "main")   // Entry point
        .add_descriptor_set(desc_set)                      
        .build()
        .enqueue(cpu_data.len() as u32, 1, 1);         // Enqueuing, not very optimus 😅

    let output = buf_c.read()?;                        // Read back C from GPU
    for (a, b) in cpu_data.into_iter().zip(output) {
        assert_eq!(a.pow(2), b);
    }

    Ok(())
}

GitHub:https://github.com/UpsettingBoy/gpgpu-rs

From 日报小组 长琴

社区学习交流平台订阅:

评论区

写评论
tokyohuang123 2021-11-10 10:21

这个sqlite和原版的性能差距有多少

1 共 1 条评论, 1 页