Documentation
¶
Index ¶
- func DecodeObject(buf []byte, val interface{}) (int, error)
- func EncodeObject(buf []byte, w thrift.NocopyWriter, val interface{}) (int, error)
- func EncodedSize(val interface{}) int
- func NoJIT(v bool)deprecated
- func Pretouch(vt reflect.Type, options ...Option) error
- func SetMaxInlineDepth(depth int) intdeprecated
- func SetMaxInlineILSize(size int) intdeprecated
- type Option
- func WithMaxInlineDepth(depth int) Optiondeprecated
- func WithMaxInlineILSize(size int) Optiondeprecated
- func WithMaxPretouchDepth(depth int) Optiondeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeObject ¶
DecodeObject deserializes buf into val with Thrift Binary Protocol.
func EncodeObject ¶
func EncodeObject(buf []byte, w thrift.NocopyWriter, val interface{}) (int, error)
EncodeObject serializes val into buf with Thrift Binary Protocol, with optional Zero-Copy thrift.NocopyWriter. buf must be large enough to contain the entire serialization result.
func EncodedSize ¶
func EncodedSize(val interface{}) int
EncodedSize measures the encoded size of val.
func Pretouch ¶ added in v0.1.4
Pretouch compiles vt ahead-of-time to avoid JIT compilation on-the-fly, in order to reduce the first-hit latency.
func SetMaxInlineDepth
deprecated
added in
v0.1.4
SetMaxInlineDepth sets the default maximum inlining depth for all types from now on.
This value can also be configured with the `FRUGAL_MAX_INLINE_DEPTH` environment variable.
The default value of this option is "2".
Returns the old opts.MaxInlineDepth value.
Deprecated: only for JIT
func SetMaxInlineILSize
deprecated
added in
v0.1.4
SetMaxInlineILSize sets the default maximum inlining IL instructions for all types from now on.
This value can also be configured with the `FRUGAL_MAX_INLINE_IL_SIZE` environment variable.
The default value of this option is "50000".
Returns the old opts.MaxInlineILSize value.
Deprecated: only for JIT
Types ¶
type Option ¶ added in v0.1.4
Option is the property setter function for opts.Options.
func WithMaxInlineDepth
deprecated
added in
v0.1.4
WithMaxInlineDepth sets the maximum inlining depth for the JIT compiler.
Increasing of this option makes the compiler inline more aggressively, which gives better runtime performance at the cost of a longer compilation time, and vice versa.
Set this option to "0" disables this limit, which means inlining everything.
The default value of this option is "2".
Deprecated: only for JIT
func WithMaxInlineILSize
deprecated
added in
v0.1.4
WithMaxInlineILSize sets the maximum IL instruction count before not inlining.
Increasing of this option makes the compiler inline more aggressively, which lead to more memory consumptions but better runtime performance, and vice versa.
Set this option to "0" disables this limit, which means unlimited inlining IL buffer.
The default value of this option is "50000".
Deprecated: only for JIT
func WithMaxPretouchDepth
deprecated
added in
v0.1.4
WithMaxPretouchDepth controls how deep the compiler goes to compile indirectly referenced types.
Larger depth means more types will be pre-compiled when pretouching, which lead to longer compilation time, but lower runtime JIT latency, and vice versa. You might want to tune this value to strike a balance between compilation time and runtime performance.
The default value "0" means unlimited, which basically turns Frugal into an AOT compiler.
This option is only available when performing pretouch, otherwise it is ignored and do not have any effect.
Deprecated: only for JIT