「 The embedded 」Hawk-Rust series : Raspberry pie camera driver

#RaspberryPi

Raspberry Pi Provides a set of GPIO( Universal input / Output ) Pin , Allows you to control electronic components for physical computing and explore the Internet of things (IoT). The camera module is Raspberry Pi Great accessory for , It allows users to take still photos and record video in full HD .

HAWK It's based on Rust Image recognition project , It uses RFID Card for user identification and Image User authentication to achieve two factor authentication . This article shows how to use Rust The program triggers the raspberry pie camera .

  • Read More

  • hawk


Use WASI General computing for blockchain

#wasi

This article comes from OasisLabs, It introduces WASI(Web Assembly System Interface ) Applications on blockchain . at present Oasis The technical architecture of the platform is currently around WASM、WASI And blockchain .

(OasisLabs It's from the University of California, Berkeley Dawn Song The blockchain project created by professors and colleagues , Based on blockchain and trusted hardware, we want to build a high-performance trusted cloud platform .)

Why do they want to WASI For blockchain ?

WASI The goal for blockchain is to take advantage of WASI Fast growing communities and infrastructure . And create another Wasm Interface ,WASI Allow blockchain developers to leverage the resources of a broader developer community . In this way , It is conceivable that in the future, blockchain will become another tool in the toolbox of cloud developers .

OasisLabs The team also specifically submitted a blockchain WASI Of RFC, I want to make it suitable for the context of blockchain WASI Dimension extension .

  • Read More

  • Blockchain WASI RFC


Rust vs C++ : be based on 36 nucleus CPU Parallel performance test of

#cpp #rayon

Some people are aiming at Rust/Rayon(Rust Implementation of multithread concurrent Library ) and C++/OpenMP(c++ Is similar to rayon The library of ) stay 36 Performance tests have been carried out on nuclear machines .

Rust 36 Threads :

Running on 36 Threads
BabelStream
Version: 0.5
Implmentation: Rust
Running kernels 100 times
Precision: double
Array size: 268.4 MB (=0.3 GB)
Total size: 805.3 MB (=0.8 GB)
Function Mbytes/sec Min (sec) Max Average
Copy 50552.817 0.01062 0.02924 0.01143
Mul 39680.038 0.01353 0.01510 0.01443
Add 45828.953 0.01757 0.01874 0.01820
Triad 41769.002 0.01928 0.02206 0.02029
Dot 43584.260 0.01232 0.01327 0.01273

CPP/OMP 36 Threads :

Running on 36 Threads
BabelStream
Version: 3.4
Implementation: OpenMP
Running kernels 100 times
Precision: double
Array size: 268.4 MB (=0.3 GB)
Total size: 805.3 MB (=0.8 GB)
Function    MBytes/sec  Min (sec)   Max         Average    
Copy        87745.870   0.00612     0.00710     0.00684    
Mul         79315.382   0.00677     0.00762     0.00736    
Add         89995.047   0.00895     0.01029     0.00992    
Triad       91574.889   0.00879     0.01012     0.00975    
Dot         118144.442  0.00454     0.00504     0.00490  

For this result , You can see Reddit Discuss some of the feedback in the post . Half of the people in the comments section think Rust Why it's slow , Because rayon Currently not supported NUMA perception (Numa aware) Why . Whether it's Rust Language , still Rayon This feature is not currently supported , Unless you wait for the memory allocator to stabilize .

(NUMA be used for x86 and IBM POWER Multiprocessor systems on architecture platforms . In possession of NUMA Characteristics of the system , Each processor has available local memory , You can also access memory allocated to other processors . Faster memory access to local memory .NUMA A node is a collection of processors and memories that are closely related to each other . Memory access is faster inside the node than outside the node . If the program can sense NUMA, That's related to computing resources , Will be placed in a different physical NUMA node . Even though it's still in two NUMA Expansion between nodes , But the use of resources will be optimized .)

But I don't know OpenMP Test whether the code used NUMA Perception to improve performance , but OpenMP It's like support NUMA( Not sure ).

  • Reddit Discuss

  • Related codes

  • rayon issues: Schedulling should be NUMA aware

  • Introduce NUMA An article from


「 Discuss 」ndarray vs nalgebra

#ml #statistical_computing

It's time to discuss this issue :ndarray and nalgebra What's the difference between these two libraries ? Advantages and disadvantages ? Which library is more likely to be used in machine learning and scientific computing ?

Comment summary :

  1. Ndarray and nalgebra For two different problem domains .

  2. Ndarray and nalgebra The repetitive part is just a linear algebraic system , and nalgebra More emphasis on linear algebraic systems , But only 1D Vector and 2D matrix .

  3. Ndarray Be similar to numpy, Apply to n Dimensional data processing .

  4. once Rust Of const generics When the function is stable , These two libraries will be deeply affected , Maybe there will be more overlapping functions in the future .

  5. nalgebra Is pure Rust Of ,ndarray There is one OpenBLAS Back end . So in terms of performance , Some programs may ndarray Better execution ( pure Rust It needs to be optimized ).

  6. If it's for engineering and mathematical purposes ,nalgebra It's the best choice so far .nalgebra The best function of is dimension checking at compile time , This means that the code with the wrong math will not compile .

Reddit Discuss


vecmerge: Provides a convenient way to merge Vec The macro

#vec

fn concat(a: i32, b: i32, c: Vec<i32>, d: i32, e: i32, f: i32) -> Vec<i32> {
   vecmerge!([a,b] + c + [d,e,f])
}

vecmerge


Support Rust In many ways

#Rust

If you want to support Rust The development of , There are many ways to support Rust:

  • Contribution code .

  • Written document 、 book 、 Blog 、 Video etc. .

  • In the BBS ,Stack Overflow,Reddit,Matrix or Discord Answer questions .

  • Financial support .

Especially financial support , It can help compensate these key contributors for their time , Make open source more sustainable . If you will , You can see Aaron List of sponsors .

  • Read More

  • Aaron List of sponsors


「 series 」 Use Rust Create a static file server Part 2

#Http

Read More