Skip to content

Commit d807030

Browse files
ahilgerfacebook-github-bot
authored andcommitted
add documentation for python.DisableFieldCache annotation
Summary: Improve explanation of `python.DisableFieldCache` Reviewed By: prakashgayasen Differential Revision: D78364087 fbshipit-source-id: d31650ce83a483a90846901f1538326e141f87fb
1 parent 919353d commit d807030

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

thrift/annotation/python.thrift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,15 @@ struct DeprecatedSortSetOnSerialize {}
128128
struct DeprecatedKeySortMapOnSerialize {}
129129

130130
/// Disable caching all fields for a struct.
131+
/// Also available as a thrift_library compiler option:
132+
/// thrift_library(..., thrift_python_options = ["disable_field_cache"])
133+
///
134+
/// Has NO effect in cinder runtime (e.g., IG Django)
135+
/// Only affects thrift-python, not older deprecated variants.
136+
///
137+
/// Usage guidelines:
138+
/// - Improves latency/throughput when struct fields accessed only once.
139+
/// - Reduces memory usage for most use cases; try this to resolve OOMs.
140+
/// - Worsens latency for subsequent field accesses relative to default.
131141
@scope.Struct
132142
struct DisableFieldCache {}

0 commit comments

Comments
 (0)