Commit ec9f5c8f authored by Jim Fulton's avatar Jim Fulton

Minor optimzation, caching the cach's update method in a loop.

parent 45cca84a
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""Network ZODB storage client """Network ZODB storage client
""" """
__version__='$Revision: 1.20 $'[11:-2] __version__='$Revision: 1.21 $'[11:-2]
import struct, time, os, socket, string, Sync, zrpc, ClientCache import struct, time, os, socket, string, Sync, zrpc, ClientCache
import tempfile, Invalidator, ExtensionClass, thread import tempfile, Invalidator, ExtensionClass, thread
...@@ -498,6 +498,7 @@ class ClientStorage(ExtensionClass.Base, BaseStorage.BaseStorage): ...@@ -498,6 +498,7 @@ class ClientStorage(ExtensionClass.Base, BaseStorage.BaseStorage):
seek=tfile.seek seek=tfile.seek
read=tfile.read read=tfile.read
cache=self._cache cache=self._cache
update=cache.update
size=tfile.tell() size=tfile.tell()
cache.checkSize(size) cache.checkSize(size)
seek(0) seek(0)
...@@ -515,7 +516,7 @@ class ClientStorage(ExtensionClass.Base, BaseStorage.BaseStorage): ...@@ -515,7 +516,7 @@ class ClientStorage(ExtensionClass.Base, BaseStorage.BaseStorage):
"Unexpected end of file in client storage " "Unexpected end of file in client storage "
"temporary file." "temporary file."
) )
cache.update(oid, s, v, p) update(oid, s, v, p)
i=i+14+vlen+dlen i=i+14+vlen+dlen
seek(0) seek(0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment