diff --git a/bench_test.go b/bench_test.go index 46f5f83..d091d84 100644 --- a/bench_test.go +++ b/bench_test.go @@ -21,3 +21,11 @@ func BenchmarkExpressions(b *testing.B) { compiler.Run() } } + +func BenchmarkHello(b *testing.B) { + compiler := build.New("examples/hello") + + for i := 0; i < b.N; i++ { + compiler.Run() + } +} diff --git a/src/build/fs/Walk.go b/src/build/fs/Walk.go index 78d6043..ce22ac5 100644 --- a/src/build/fs/Walk.go +++ b/src/build/fs/Walk.go @@ -5,8 +5,6 @@ import ( "unsafe" ) -const blockSize = 4096 - // Walk calls your callback function for every file name inside the directory. // It doesn't distinguish between files and directories. func Walk(directory string, callBack func(string)) error { @@ -17,7 +15,7 @@ func Walk(directory string, callBack func(string)) error { } defer syscall.Close(fd) - buffer := make([]byte, blockSize) + buffer := make([]byte, 1024) for { n, err := syscall.ReadDirent(fd, buffer)