@@ -5,21 +5,21 @@ go tool pprof --alloc_objects uidassigner heap.prof
5
5
Dropped 41 nodes (cum <= 1039438)
6
6
Showing top 10 nodes out of 31 (cum >= 8566234)
7
7
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
10
10
20406729 9.82% 50.12% 20406729 9.82% github.com/zond/gotomic.newRealEntryWithHashCode
11
11
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
14
14
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
16
16
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
18
18
19
19
20
20
(pprof) list rdf.Parse
21
21
Total: 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
23
23
55529704 55529704 (flat, cum) 26.71% of Total
24
24
. . 118: }
25
25
. . 119: return val[1 : len(val)-1]
@@ -43,14 +43,14 @@ Showing top 10 nodes out of 62 (cum >= 18180150)
43
43
flat flat% sum% cum cum%
44
44
103445194 18.46% 18.46% 103445194 18.46% github.com/Sirupsen/logrus.(*Entry).WithFields
45
45
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
49
49
35190301 6.28% 58.69% 35190301 6.28% github.com/google/flatbuffers/go.(*Builder).growByteBuffer
50
50
31392455 5.60% 64.29% 31392455 5.60% github.com/zond/gotomic.newRealEntryWithHashCode
51
51
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
54
54
55
55
After a few more discussions, I realized that lexer didn't need to be allocated on the heap.
56
56
So, I switched it to be allocated on stack. These are the results.
@@ -62,14 +62,14 @@ Entering interactive mode (type "help" for commands)
62
62
Dropped 73 nodes (cum <= 8.48MB)
63
63
Showing top 10 nodes out of 52 (cum >= 161.50MB)
64
64
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
66
66
209.55MB 12.35% 30.30% 209.55MB 12.35% github.com/Sirupsen/logrus.(*Entry).WithFields
67
67
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
69
69
88MB 5.19% 54.09% 88MB 5.19% github.com/zond/gotomic.newMockEntry
70
70
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
73
73
76MB 4.48% 72.80% 76MB 4.48% github.com/zond/gotomic.newRealEntryWithHashCode
74
74
73.50MB 4.33% 77.14% 161.50MB 9.52% github.com/zond/gotomic.(*Hash).getBucketByIndex
75
75
0 commit comments