Documentation ¶
Overview ¶
Package vet is a Beam runner that "runs" a pipeline by producing generated code to avoid symbol table lookups and reflection in pipeline execution.
This runner isn't necessarily intended to be run by itself. Other runners can use this as a sanity check on whether a given pipeline avoids known performance bottlenecks.
TODO(BEAM-7374): Add usage documentation.
Index ¶
- func Execute(ctx context.Context, p *beam.Pipeline) error
- func NameType(t reflect.Type) string
- type Eval
- func (e *Eval) AllExported() bool
- func (e *Eval) Bytes() []byte
- func (e *Eval) Generate(packageName string)
- func (e *Eval) Performant() bool
- func (e *Eval) Print(s string)
- func (e *Eval) Printf(f string, args ...interface{})
- func (e *Eval) RequiresRegistrations() bool
- func (e *Eval) UsesDefaultReflectionShims() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
Execute evaluates the pipeline on whether it can run without reflection.
Types ¶
type Eval ¶
type Eval struct {
// contains filtered or unexported fields
}
Eval contains and uniquifies the cache of types and things that need to be generated.
func Evaluate ¶
Evaluate returns an object that can generate necessary shims and inits.
func (*Eval) AllExported ¶
AllExported returns whether all values in the pipeline are exported, and thus it may be possible to patch the pipeline's package with generated shims. Using exported vs unexported identifiers does not affect pipeline performance but does matter on if the pipeline package can do anything about it.
func (*Eval) Bytes ¶
Bytes returns the Eval buffer's bytes for file writing.
func (*Eval) Generate ¶
Generate produces a go file under the given package.
func (*Eval) Performant ¶
Performant returns whether this pipeline needs additional registrations to avoid reflection, or symbol lookups at runtime.
func (*Eval) Printf ¶
Printf invokes fmt.Fprintf on the Eval buffer.
func (*Eval) RequiresRegistrations ¶
RequiresRegistrations returns if there are any types or functions that require registrations.
Directories ¶
Path | Synopsis |
---|---|
Package testpipeline exports small test pipelines for testing the vet runner.
|
Package testpipeline exports small test pipelines for testing the vet runner. |