Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for ByWeight (0.36 sec)

  1. src/cmd/internal/pgo/serialize_test.go

    	}
    	if !reflect.DeepEqual(got.NamedEdgeMap.ByWeight, want.NamedEdgeMap.ByWeight) {
    		return fmt.Errorf("got.NamedEdgeMap.ByWeight != want.NamedEdgeMap.ByWeight\ngot = %+v\nwant = %+v", got.NamedEdgeMap.ByWeight, want.NamedEdgeMap.ByWeight)
    	}
    	if !reflect.DeepEqual(got.NamedEdgeMap.Weight, want.NamedEdgeMap.Weight) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 20:20:01 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  2. src/cmd/internal/pgo/pprof.go

    		return NamedEdgeMap{}, 0, nil // accept but ignore profile with no samples.
    	}
    	byWeight := make([]NamedCallEdge, 0, len(weight))
    	for namedEdge := range weight {
    		byWeight = append(byWeight, namedEdge)
    	}
    	sortByWeight(byWeight, weight)
    
    	edgeMap = NamedEdgeMap{
    		Weight:   weight,
    		ByWeight: byWeight,
    	}
    
    	totalWeight = weightVal
    
    	return edgeMap, totalWeight, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 20:20:01 UTC 2024
    - 4K bytes
    - Viewed (0)
  3. src/sort/example_wrapper_test.go

    type ByName struct{ Organs }
    
    func (s ByName) Less(i, j int) bool { return s.Organs[i].Name < s.Organs[j].Name }
    
    // ByWeight implements sort.Interface by providing Less and using the Len and
    // Swap methods of the embedded Organs value.
    type ByWeight struct{ Organs }
    
    func (s ByWeight) Less(i, j int) bool { return s.Organs[i].Weight < s.Organs[j].Weight }
    
    func Example_sortWrapper() {
    	s := []*Organ{
    		{"brain", 1340},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 1.6K bytes
    - Viewed (0)
  4. src/cmd/internal/pgo/pgo.go

    type NamedEdgeMap struct {
    	Weight map[NamedCallEdge]int64
    
    	// ByWeight lists all keys in Weight, sorted by edge weight from
    	// highest to lowest.
    	ByWeight []NamedCallEdge
    }
    
    func emptyProfile() *Profile {
    	// Initialize empty maps/slices for easier use without a requiring a
    	// nil check.
    	return &Profile{
    		NamedEdgeMap: NamedEdgeMap{
    			ByWeight: make([]NamedCallEdge, 0),
    			Weight:   make(map[NamedCallEdge]int64),
    		},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 20:20:01 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  5. src/cmd/internal/pgo/deserialize.go

    		}
    
    		if _, ok := d.NamedEdgeMap.Weight[edge]; ok {
    			return nil, fmt.Errorf("preprocessed profile contains duplicate edge %+v", edge)
    		}
    
    		d.NamedEdgeMap.ByWeight = append(d.NamedEdgeMap.ByWeight, edge) // N.B. serialization is ordered.
    		d.NamedEdgeMap.Weight[edge] += weight
    		d.TotalWeight += weight
    	}
    
    	return d, nil
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 20:20:01 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  6. src/cmd/internal/pgo/serialize.go

    	var written int64
    
    	// Header
    	n, err := bw.WriteString(serializationHeader)
    	written += int64(n)
    	if err != nil {
    		return written, err
    	}
    
    	for _, edge := range d.NamedEdgeMap.ByWeight {
    		weight := d.NamedEdgeMap.Weight[edge]
    
    		n, err = fmt.Fprintln(bw, edge.CallerName)
    		written += int64(n)
    		if err != nil {
    			return written, err
    		}
    
    		n, err = fmt.Fprintln(bw, edge.CalleeName)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 20:20:01 UTC 2024
    - 1.8K bytes
    - Viewed (0)
Back to top