Commit fada13be authored by George Hotz's avatar George Hotz

profile minigeth...no real hot spots

parent c9024c00
...@@ -73,7 +73,6 @@ contract MIPS { ...@@ -73,7 +73,6 @@ contract MIPS {
return uint32(dat&mask | (isSigned ? signed : 0)); return uint32(dat&mask | (isSigned ? signed : 0));
} }
function handleSyscall(bytes32 stateHash) internal returns (bytes32) { function handleSyscall(bytes32 stateHash) internal returns (bytes32) {
uint32 syscall_no = ReadMemory(stateHash, REG_OFFSET+2*4); uint32 syscall_no = ReadMemory(stateHash, REG_OFFSET+2*4);
uint32 v0 = 0; uint32 v0 = 0;
...@@ -215,7 +214,7 @@ contract MIPS { ...@@ -215,7 +214,7 @@ contract MIPS {
if (opcode == 0 && func >= 8 && func < 0x1c) { if (opcode == 0 && func >= 8 && func < 0x1c) {
if (func == 8 || func == 9) { if (func == 8 || func == 9) {
// jr/jalr // jr/jalr
return branchDelay(stateHash, nextPC, val | (func == 9 ? PC_FLAG : 0)); return branchDelay(stateHash, nextPC, rs | (func == 9 ? PC_FLAG : 0));
} }
// handle movz and movn when they don't write back // handle movz and movn when they don't write back
......
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"log" "log"
"math/big" "math/big"
"os" "os"
"runtime/pprof"
"strconv" "strconv"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
...@@ -27,8 +28,14 @@ func check(err error) { ...@@ -27,8 +28,14 @@ func check(err error) {
} }
func main() { func main() {
// init secp256k1BytePoints if len(os.Args) > 2 {
crypto.S256() f, err := os.Create(os.Args[2])
if err != nil {
log.Fatal(err)
}
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
}
// non mips // non mips
if len(os.Args) > 1 { if len(os.Args) > 1 {
...@@ -43,6 +50,9 @@ func main() { ...@@ -43,6 +50,9 @@ func main() {
fmt.Println("commited transactions", hash, err) fmt.Println("commited transactions", hash, err)
} }
// init secp256k1BytePoints
crypto.S256()
// read start block header // read start block header
var parent types.Header var parent types.Header
check(rlp.DecodeBytes(oracle.Preimage(oracle.Input(0)), &parent)) check(rlp.DecodeBytes(oracle.Preimage(oracle.Input(0)), &parent))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment