Throwaway prototypes for Sausage v3. Plan and decisions: ~/research/sausage-v3/PLAN.md. Results and evidence: the spike READMEs.
28 lines
551 B
Go
28 lines
551 B
Go
// Minimal Go runtime initialization and clock probe for the adapter.
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
_ "net/http"
|
|
"time"
|
|
)
|
|
|
|
var blob [20 << 20]byte
|
|
var allocations [][]byte
|
|
|
|
func init() {
|
|
for i := 0; i < 20000; i++ {
|
|
allocations = append(allocations, make([]byte, 1024))
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
blob[0] = 1
|
|
fmt.Println("Go WASI clock before allocation:", time.Now().UnixNano(), blob[0])
|
|
data := make([]byte, 32<<20)
|
|
for i := range data {
|
|
data[i] = 1
|
|
}
|
|
fmt.Println("Go WASI clock after allocation:", time.Now().UnixNano(), data[len(data)-1])
|
|
}
|