From this tweet
Q: The fastest way to read a text file line by line
47Gb file -> 5hrs
Console.Write
each loop -> 45 mins to read the file (.NET 6)
1.File.ReadLines()
\
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
// Name of the struct tag used in examples | |
const tagName = "validate" |
# Step 1: target at versions you want to delete | |
# Step 2: chmod +x delete_dotnet_core.sh | |
# Step 3: ./delete_dotnet_core.sh | |
# Target sdks to remove | |
declare -a sdkVersions=("3.0.101" "3.1.401") | |
for sdkVersion in "${sdkVersions[@]}" | |
do | |
sudo rm -rf /usr/local/share/dotnet/sdk/$sdkVersion | |
# sudo rm -rf /usr/local/share/dotnet/sdk-manifests/$sdkVersion |
From this tweet
Q: The fastest way to read a text file line by line
47Gb file -> 5hrs
Console.Write
each loop -> 45 mins to read the file (.NET 6)
1.File.ReadLines()
\
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
The Linux kernel is written in C, so you should have at least a basic understanding of C before diving into kernel work. You don't need expert level C knowledge, since you can always pick some things up underway, but it certainly helps to know the language and to have written some userspace C programs already.
It will also help to be a Linux user. If you have never used Linux before, it's probably a good idea to download a distro and get comfortable with it before you start doing kernel work.
Lastly, knowing git is not actually required, but can really help you (since you can dig through changelogs and search for information you'll need). At a minimum you should probably be able to clone the git repository to a local directory.
Env: macOS Catalina
10.15.7
Step1: git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
Although it doesn't need
--recursive
in README, this issue still happened on mac.
Step2: brew install python3 gawk gnu-sed gmp mpfr libmpc isl zlib expat
Step3: cd riscv-gnu-toolchain
directory and ./configure --prefix=/opt/riscv --enable-multilib
To build either cross-compiler with support for both 32-bit and 64-bit