Documentation
¶
Overview ¶
Package fastparser implements a high-performance XML parser without AST construction.
This parser is optimized for direct parsing to Go native types (map[string]interface{}). It bypasses AST construction, parsing directly from bytes to Go values for minimal overhead.
This is the "fast path" in the dual-path parser pattern. Use this for:
- Unmarshal: Populate Go structs from XML (4-5x faster than AST path)
- Validate: Check XML well-formedness (4-5x faster than AST path)
Performance targets (vs AST parser):
- 4-5x faster parsing
- 5-6x less memory
- 4-5x fewer allocations
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unmarshal ¶
Unmarshal parses XML and unmarshals it into the value pointed to by v. This is the fast path that bypasses AST construction.
func UnmarshalValue ¶
UnmarshalValue unmarshals a parsed value into a reflect.Value. This is exported for use by the AST path unmarshal function.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser implements a zero-allocation XML validator that checks well-formedness without AST.
type Unmarshaler ¶
Unmarshaler is the interface implemented by types that can unmarshal an XML description of themselves.