Files
sausage/spikes/s6-esbuild/hello.go
T
surma 9e9cde5241 spikes: six v3 spikes (V8 harness, WASI shell, git, builder, http hook, esbuild)
Throwaway prototypes for Sausage v3. Plan and decisions:
~/research/sausage-v3/PLAN.md. Results and evidence: the spike READMEs.
2026-11-06 14:03:20 +00:00

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])
}