Skip to content

tesuji/bench-let-readonly-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bench targets

  • small size <= 16 bytes: llvm inlines as single mov: 1, 2, 4, 8, 16
  • medium <= 256 bytes: llvm inlines memcpy as multiple move: 32, 64, 128, 256
  • large > 256 bytes: llvm uses memcpy: 512, 1024, 2048, 4096

Literal:

  • integers, static string
  • String?

Bench this code

pub fn indexing(x: usize) -> u8 {
	let array: [u8; N] = ?;
	array[x]
}

Need: codegen? to

  • generate array
  • a simple [{int}; N]: memcpy? zero or non-zero
  • random items: [1, 2, ..., rand()]
  • x:
    • is inside: choose happy path
    • out of bound => panic ?

output: rustc -Vv bench machine: cpu, os? plot .dot/.svg

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages