@@ -5,21 +5,21 @@ go tool pprof --alloc_objects uidassigner heap.prof
55Dropped 41 nodes (cum <= 1039438)
66Showing top 10 nodes out of 31 (cum >= 8566234)
77 flat flat% sum% cum cum%
8- 55529704 26.71% 26.71% 55529704 26.71% github.com/dgraph-io/dgraph /rdf.Parse
9- 28255068 13.59% 40.30% 30647245 14.74% github.com/dgraph-io/dgraph /posting.(*List).getPostingList
8+ 55529704 26.71% 26.71% 55529704 26.71% github.com/hypermodeinc/dggraph /rdf.Parse
9+ 28255068 13.59% 40.30% 30647245 14.74% github.com/hypermodeinc/dggraph /posting.(*List).getPostingList
1010 20406729 9.82% 50.12% 20406729 9.82% github.com/zond/gotomic.newRealEntryWithHashCode
1111 17777182 8.55% 58.67% 17777182 8.55% strings.makeCutsetFunc
12- 17582839 8.46% 67.13% 17706815 8.52% github.com/dgraph-io/dgraph /loader.(*state).readLines
13- 15139047 7.28% 74.41% 88445933 42.55% github.com/dgraph-io/dgraph /loader.(*state).parseStream
12+ 17582839 8.46% 67.13% 17706815 8.52% github.com/hypermodeinc/dggraph /loader.(*state).readLines
13+ 15139047 7.28% 74.41% 88445933 42.55% github.com/hypermodeinc/dggraph /loader.(*state).parseStream
1414 12927366 6.22% 80.63% 12927366 6.22% github.com/zond/gotomic.(*element).search
15- 10789028 5.19% 85.82% 66411362 31.95% github.com/dgraph-io/dgraph /posting.GetOrCreate
15+ 10789028 5.19% 85.82% 66411362 31.95% github.com/hypermodeinc/dggraph /posting.GetOrCreate
1616 9453856 4.55% 90.37% 9453856 4.55% github.com/zond/gotomic.(*hashHit).search
17- 8566234 4.12% 94.49% 8566234 4.12% github.com/dgraph-io/dgraph /uid.stringKey
17+ 8566234 4.12% 94.49% 8566234 4.12% github.com/hypermodeinc/dggraph /uid.stringKey
1818
1919
2020(pprof) list rdf.Parse
2121Total: 207887723
22- ROUTINE ======================== github.com/dgraph-io/dgraph /rdf.Parse in /home/mrjn/go/src/github.com/dgraph-io/dgraph /rdf/parse.go
22+ ROUTINE ======================== github.com/hypermodeinc/dggraph /rdf.Parse in /home/mrjn/go/src/github.com/hypermodeinc/dggraph /rdf/parse.go
2323 55529704 55529704 (flat, cum) 26.71% of Total
2424 . . 118: }
2525 . . 119: return val[1 : len(val)-1]
@@ -43,14 +43,14 @@ Showing top 10 nodes out of 62 (cum >= 18180150)
4343 flat flat% sum% cum cum%
4444 103445194 18.46% 18.46% 103445194 18.46% github.com/Sirupsen/logrus.(*Entry).WithFields
4545 65448918 11.68% 30.14% 163184489 29.12% github.com/Sirupsen/logrus.(*Entry).WithField
46- 48366300 8.63% 38.77% 203838187 36.37% github.com/dgraph-io/dgraph /posting.(*List).get
47- 39789719 7.10% 45.87% 49276181 8.79% github.com/dgraph-io/dgraph /posting.(*List).getPostingList
48- 36642638 6.54% 52.41% 36642638 6.54% github.com/dgraph-io/dgraph /lex.NewLexer
46+ 48366300 8.63% 38.77% 203838187 36.37% github.com/hypermodeinc/dggraph /posting.(*List).get
47+ 39789719 7.10% 45.87% 49276181 8.79% github.com/hypermodeinc/dggraph /posting.(*List).getPostingList
48+ 36642638 6.54% 52.41% 36642638 6.54% github.com/hypermodeinc/dggraph /lex.NewLexer
4949 35190301 6.28% 58.69% 35190301 6.28% github.com/google/flatbuffers/go.(*Builder).growByteBuffer
5050 31392455 5.60% 64.29% 31392455 5.60% github.com/zond/gotomic.newRealEntryWithHashCode
5151 25895676 4.62% 68.91% 25895676 4.62% github.com/zond/gotomic.(*element).search
52- 18546971 3.31% 72.22% 72863016 13.00% github.com/dgraph-io/dgraph /loader.(*state).parseStream
53- 18090764 3.23% 75.45% 18180150 3.24% github.com/dgraph-io/dgraph /loader.(*state).readLines
52+ 18546971 3.31% 72.22% 72863016 13.00% github.com/hypermodeinc/dggraph /loader.(*state).parseStream
53+ 18090764 3.23% 75.45% 18180150 3.24% github.com/hypermodeinc/dggraph /loader.(*state).readLines
5454
5555After a few more discussions, I realized that lexer didn't need to be allocated on the heap.
5656So, I switched it to be allocated on stack. These are the results.
@@ -62,14 +62,14 @@ Entering interactive mode (type "help" for commands)
6262Dropped 73 nodes (cum <= 8.48MB)
6363Showing top 10 nodes out of 52 (cum >= 161.50MB)
6464 flat flat% sum% cum cum%
65- 304.56MB 17.95% 17.95% 304.56MB 17.95% github.com/dgraph-io/dgraph /posting.NewList
65+ 304.56MB 17.95% 17.95% 304.56MB 17.95% github.com/hypermodeinc/dggraph /posting.NewList
6666 209.55MB 12.35% 30.30% 209.55MB 12.35% github.com/Sirupsen/logrus.(*Entry).WithFields
6767 207.55MB 12.23% 42.54% 417.10MB 24.58% github.com/Sirupsen/logrus.(*Entry).WithField
68- 108MB 6.37% 48.90% 108MB 6.37% github.com/dgraph-io/dgraph /uid.(*lockManager).newOrExisting
68+ 108MB 6.37% 48.90% 108MB 6.37% github.com/hypermodeinc/dggraph /uid.(*lockManager).newOrExisting
6969 88MB 5.19% 54.09% 88MB 5.19% github.com/zond/gotomic.newMockEntry
7070 85.51MB 5.04% 59.13% 85.51MB 5.04% github.com/google/flatbuffers/go.(*Builder).growByteBuffer
71- 78.01MB 4.60% 63.73% 78.01MB 4.60% github.com/dgraph-io/dgraph /posting.Key
72- 78.01MB 4.60% 68.32% 78.51MB 4.63% github.com/dgraph-io/dgraph /uid.stringKey
71+ 78.01MB 4.60% 63.73% 78.01MB 4.60% github.com/hypermodeinc/dggraph /posting.Key
72+ 78.01MB 4.60% 68.32% 78.51MB 4.63% github.com/hypermodeinc/dggraph /uid.stringKey
7373 76MB 4.48% 72.80% 76MB 4.48% github.com/zond/gotomic.newRealEntryWithHashCode
7474 73.50MB 4.33% 77.14% 161.50MB 9.52% github.com/zond/gotomic.(*Hash).getBucketByIndex
7575
0 commit comments