Skip to content

Instantly share code, notes, and snippets.

@agyryk
Created October 21, 2016 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agyryk/25ba1b2de86a890e7bb4a9a119731659 to your computer and use it in GitHub Desktop.
Save agyryk/25ba1b2de86a890e7bb4a9a119731659 to your computer and use it in GitHub Desktop.
date facets query - CPU
ROUTINE ======================== github.com/blevesearch/bleve/index/upsidedown.(*BackIndexRowValue).Unmarshal in /home/couchbase/jenkins/workspace/couchbase-server-unix/godeps/src/github.com/blevesearch/bleve/index/upsidedown/upsidedown.pb.go
22.34s 7.39mins (flat, cum) 75.56% of Total
. . 276: return new(github_com_golang_protobuf_proto.RequiredNotSetError)
. . 277: }
. . 278:
. . 279: return nil
. . 280:}
10ms 10ms 281:func (m *BackIndexRowValue) Unmarshal(data []byte) error {
. . 282: l := len(data)
170ms 170ms 283: iNdEx := 0
510ms 510ms 284: for iNdEx < l {
60ms 60ms 285: var wire uint64
90ms 90ms 286: for shift := uint(0); ; shift += 7 {
320ms 320ms 287: if iNdEx >= l {
. . 288: return io.ErrUnexpectedEOF
. . 289: }
80ms 80ms 290: b := data[iNdEx]
340ms 340ms 291: iNdEx++
1.73s 1.73s 292: wire |= (uint64(b) & 0x7F) << shift
20ms 20ms 293: if b < 0x80 {
. . 294: break
. . 295: }
. . 296: }
460ms 460ms 297: fieldNum := int32(wire >> 3)
140ms 140ms 298: wireType := int(wire & 0x7)
. . 299: switch fieldNum {
290ms 290ms 300: case 1:
60ms 60ms 301: if wireType != 2 {
. . 302: return fmt.Errorf("proto: wrong wireType = %d for field TermEntries", wireType)
. . 303: }
. . 304: var msglen int
. . 305: for shift := uint(0); ; shift += 7 {
330ms 330ms 306: if iNdEx >= l {
. . 307: return io.ErrUnexpectedEOF
. . 308: }
190ms 190ms 309: b := data[iNdEx]
810ms 810ms 310: iNdEx++
1.96s 1.96s 311: msglen |= (int(b) & 0x7F) << shift
70ms 70ms 312: if b < 0x80 {
. . 313: break
. . 314: }
. . 315: }
80ms 80ms 316: postIndex := iNdEx + msglen
400ms 400ms 317: if msglen < 0 {
. . 318: return ErrInvalidLengthUpsidedown
. . 319: }
60ms 60ms 320: if postIndex > l {
. . 321: return io.ErrUnexpectedEOF
. . 322: }
8.94s 3.46mins 323: m.TermEntries = append(m.TermEntries, &BackIndexTermEntry{})
5.15s 3.79mins 324: if err := m.TermEntries[len(m.TermEntries)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
. . 325: return err
. . 326: }
. . 327: iNdEx = postIndex
. . 328: case 2:
. . 329: if wireType != 2 {
. . 330: return fmt.Errorf("proto: wrong wireType = %d for field StoredEntries", wireType)
. . 331: }
. . 332: var msglen int
. . 333: for shift := uint(0); ; shift += 7 {
. . 334: if iNdEx >= l {
. . 335: return io.ErrUnexpectedEOF
. . 336: }
. . 337: b := data[iNdEx]
. . 338: iNdEx++
. . 339: msglen |= (int(b) & 0x7F) << shift
. . 340: if b < 0x80 {
. . 341: break
. . 342: }
. . 343: }
. . 344: postIndex := iNdEx + msglen
. . 345: if msglen < 0 {
. . 346: return ErrInvalidLengthUpsidedown
. . 347: }
. . 348: if postIndex > l {
. . 349: return io.ErrUnexpectedEOF
. . 350: }
. . 351: m.StoredEntries = append(m.StoredEntries, &BackIndexStoreEntry{})
. . 352: if err := m.StoredEntries[len(m.StoredEntries)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
. . 353: return err
. . 354: }
. . 355: iNdEx = postIndex
. . 356: default:
. . 357: var sizeOfWire int
. . 358: for {
. . 359: sizeOfWire++
. . 360: wire >>= 7
. . 361: if wire == 0 {
. . 362: break
. . 363: }
. . 364: }
. . 365: iNdEx -= sizeOfWire
. . 366: skippy, err := skipUpsidedown(data[iNdEx:])
. . 367: if err != nil {
. . 368: return err
. . 369: }
. . 370: if skippy < 0 {
. . 371: return ErrInvalidLengthUpsidedown
. . 372: }
. . 373: if (iNdEx + skippy) > l {
. . 374: return io.ErrUnexpectedEOF
. . 375: }
. . 376: m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
. . 377: iNdEx += skippy
. . 378: }
. . 379: }
. . 380:
70ms 70ms 381: return nil
. . 382:}
. . 383:func skipUpsidedown(data []byte) (n int, err error) {
. . 384: l := len(data)
. . 385: iNdEx := 0
. . 386: for iNdEx < l {
ROUTINE ======================== github.com/blevesearch/bleve/index/upsidedown.(*BackIndexTermEntry).Unmarshal in /home/couchbase/jenkins/workspace/couchbase-server-unix/godeps/src/github.com/blevesearch/bleve/index/upsidedown/upsidedown.pb.go
33.46s 3.70mins (flat, cum) 37.87% of Total
. . 96: return m.StoredEntries
. . 97: }
. . 98: return nil
. . 99:}
. . 100:
1.16s 1.16s 101:func (m *BackIndexTermEntry) Unmarshal(data []byte) error {
10ms 10ms 102: var hasFields [1]uint64
10ms 10ms 103: l := len(data)
50ms 50ms 104: iNdEx := 0
1.83s 1.83s 105: for iNdEx < l {
540ms 540ms 106: var wire uint64
520ms 520ms 107: for shift := uint(0); ; shift += 7 {
390ms 390ms 108: if iNdEx >= l {
. . 109: return io.ErrUnexpectedEOF
. . 110: }
540ms 540ms 111: b := data[iNdEx]
850ms 850ms 112: iNdEx++
3.06s 3.06s 113: wire |= (uint64(b) & 0x7F) << shift
220ms 220ms 114: if b < 0x80 {
. . 115: break
. . 116: }
. . 117: }
700ms 700ms 118: fieldNum := int32(wire >> 3)
570ms 570ms 119: wireType := int(wire & 0x7)
. . 120: switch fieldNum {
150ms 150ms 121: case 1:
60ms 60ms 122: if wireType != 2 {
. . 123: return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
. . 124: }
. . 125: var stringLen uint64
. . 126: for shift := uint(0); ; shift += 7 {
50ms 50ms 127: if iNdEx >= l {
. . 128: return io.ErrUnexpectedEOF
. . 129: }
320ms 320ms 130: b := data[iNdEx]
900ms 900ms 131: iNdEx++
1.08s 1.08s 132: stringLen |= (uint64(b) & 0x7F) << shift
200ms 200ms 133: if b < 0x80 {
. . 134: break
. . 135: }
. . 136: }
530ms 530ms 137: postIndex := iNdEx + int(stringLen)
60ms 60ms 138: if postIndex > l {
. . 139: return io.ErrUnexpectedEOF
. . 140: }
6.57s 2.69mins 141: s := string(data[iNdEx:postIndex])
800ms 860ms 142: m.Term = &s
. . 143: iNdEx = postIndex
390ms 390ms 144: hasFields[0] |= uint64(0x00000001)
220ms 220ms 145: case 2:
450ms 450ms 146: if wireType != 0 {
. . 147: return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType)
. . 148: }
1.96s 36s 149: var v uint32
2.64s 2.64s 150: for shift := uint(0); ; shift += 7 {
560ms 560ms 151: if iNdEx >= l {
. . 152: return io.ErrUnexpectedEOF
. . 153: }
40ms 40ms 154: b := data[iNdEx]
540ms 540ms 155: iNdEx++
2.04s 2.04s 156: v |= (uint32(b) & 0x7F) << shift
30ms 30ms 157: if b < 0x80 {
. . 158: break
. . 159: }
. . 160: }
1.55s 1.59s 161: m.Field = &v
90ms 90ms 162: hasFields[0] |= uint64(0x00000002)
. . 163: default:
. . 164: var sizeOfWire int
. . 165: for {
. . 166: sizeOfWire++
. . 167: wire >>= 7
. . 168: if wire == 0 {
. . 169: break
. . 170: }
. . 171: }
. . 172: iNdEx -= sizeOfWire
. . 173: skippy, err := skipUpsidedown(data[iNdEx:])
. . 174: if err != nil {
. . 175: return err
. . 176: }
. . 177: if skippy < 0 {
. . 178: return ErrInvalidLengthUpsidedown
. . 179: }
. . 180: if (iNdEx + skippy) > l {
. . 181: return io.ErrUnexpectedEOF
. . 182: }
. . 183: m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
. . 184: iNdEx += skippy
. . 185: }
. . 186: }
370ms 370ms 187: if hasFields[0]&uint64(0x00000001) == 0 {
. . 188: return new(github_com_golang_protobuf_proto.RequiredNotSetError)
. . 189: }
540ms 540ms 190: if hasFields[0]&uint64(0x00000002) == 0 {
. . 191: return new(github_com_golang_protobuf_proto.RequiredNotSetError)
. . 192: }
. . 193:
870ms 870ms 194: return nil
. . 195:}
. . 196:func (m *BackIndexStoreEntry) Unmarshal(data []byte) error {
. . 197: var hasFields [1]uint64
. . 198: l := len(data)
. . 199: iNdEx := 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment