Draft
Conversation
Collaborator
Author
BenchmarkSimpleArithmetic (단순 산술 연산)
BenchmarkSumArithmetic (합산 연산)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
벤치마크 실행 결과
$ go test -run="-" -bench="SimpleArithmetic" -benchmem "./jit"
goos: linux
goarch: amd64
pkg: github.com/siyul-park/minivm/jit
cpu: Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
BenchmarkSimpleArithmetic/Interpreter-6 200377 5644 ns/op 20928 B/op 16 allocs/op
BenchmarkSimpleArithmetic/JIT-6 86763 13689 ns/op 396 B/op 7 allocs/op
PASS
ok github.com/siyul-park/minivm/jit 2.327ssh
$ go test -run="-" -bench="SumArithmetic" -benchmem "./jit"
goos: linux
goarch: amd64
pkg: github.com/siyul-park/minivm/jit
cpu: Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
BenchmarkSumArithmetic/Interpreter-6 34125 34801 ns/op 77748 B/op 514 allocs/op
BenchmarkSumArithmetic/JIT-6 38337 31050 ns/op 24716 B/op 15 allocs/op
PASS
ok github.com/siyul-park/minivm/jit 2.386s
벤치마크 결과 분석
1. BenchmarkSimpleArithmetic (단순 산술 연산)
결론: 단순 연산에서는 Interpreter가 더 빠르지만, JIT는 메모리와 할당이 훨씬 적음.
2. BenchmarkSumArithmetic (합산 연산)
결론: 반복/합산 연산에서는 JIT가 더 빠르고, 메모리와 할당이 훨씬 적음.
종합 분석
시사점: JIT는 반복 실행이 많은 워크로드에서 유리하며, 메모리 효율이 전반적으로 우수함.