Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0e5b718

Browse files
authored
fix(perf): improve performance unmarshalling entities from protobuf2 (#175)
Uses direct access of pb2 object when iterating over Entity.properties. This reduces the time required to hydrate query results by 50%
1 parent57b0fe6 commit0e5b718

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎google/cloud/datastore/helpers.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def entity_from_protobuf(pb):
138138
entity_meanings= {}
139139
exclude_from_indexes= []
140140

141-
forprop_name,value_pbin_property_tuples(proto_pb):
141+
forprop_name,value_pbin_property_tuples(proto_pb._pb):
142142
value=_get_value_from_value_pb(value_pb)
143143
entity_props[prop_name]=value
144144

@@ -154,7 +154,7 @@ def entity_from_protobuf(pb):
154154
ifis_listandlen(value)>0:
155155
exclude_values=set(
156156
value_pb.exclude_from_indexes
157-
forvalue_pbinvalue_pb._pb.array_value.values
157+
forvalue_pbinvalue_pb.array_value.values
158158
)
159159
iflen(exclude_values)!=1:
160160
raiseValueError(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp