summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorcduvall@chromium.org <cduvall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-21 01:51:34 +0000
committercduvall@chromium.org <cduvall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-21 01:51:34 +0000
commitfe02768e5e5e86ce3bcab2b14e284b6b3f401443 (patch)
tree8597e6c4538699ef95178518d4a0e0e77ced7194 /tools
parentb1956bc7e934bf95418a307ddc9cbf882a0749ff (diff)
downloadchromium_src-fe02768e5e5e86ce3bcab2b14e284b6b3f401443.zip
chromium_src-fe02768e5e5e86ce3bcab2b14e284b6b3f401443.tar.gz
chromium_src-fe02768e5e5e86ce3bcab2b14e284b6b3f401443.tar.bz2
Extensions Docs Server: Large performance increase
Based off: https://chromiumcodereview.appspot.com/10834329 This adds a few things to speed up performance: 1. Caches items in memcache from FileSystemCache. 2. Caches everything primarily in memory, and falls back on memcache. 3. 5 minute timeout on stats. 4. Cron job to update memcache every 5 minutes (just enough time to update expired stats). 5. Memcache uses set_multi_async and get_multi_async where applicable. I have an instance at chrome-docs-test.appspot.com, but the cron job is only running every 10 minutes so I don't go over quota. After the cron job is run, even samples.html is fast! Review URL: https://chromiumcodereview.appspot.com/10829348 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152472 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r--tools/json_schema_compiler/model.py46
1 files changed, 24 insertions, 22 deletions
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py
index 76b27b2..0c18c91 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -299,31 +299,33 @@ class Property(object):
unix_name = property(GetUnixName, SetUnixName)
+class _PropertyTypeInfo(object):
+ """This class is not an inner class of |PropertyType| so it can be pickled.
+ """
+ def __init__(self, is_fundamental, name):
+ self.is_fundamental = is_fundamental
+ self.name = name
+
+ def __repr__(self):
+ return self.name
+
class PropertyType(object):
"""Enum of different types of properties/parameters.
"""
- class _Info(object):
- def __init__(self, is_fundamental, name):
- self.is_fundamental = is_fundamental
- self.name = name
-
- def __repr__(self):
- return self.name
-
- INTEGER = _Info(True, "INTEGER")
- INT64 = _Info(True, "INT64")
- DOUBLE = _Info(True, "DOUBLE")
- BOOLEAN = _Info(True, "BOOLEAN")
- STRING = _Info(True, "STRING")
- ENUM = _Info(False, "ENUM")
- ARRAY = _Info(False, "ARRAY")
- REF = _Info(False, "REF")
- CHOICES = _Info(False, "CHOICES")
- OBJECT = _Info(False, "OBJECT")
- FUNCTION = _Info(False, "FUNCTION")
- BINARY = _Info(False, "BINARY")
- ANY = _Info(False, "ANY")
- ADDITIONAL_PROPERTIES = _Info(False, "ADDITIONAL_PROPERTIES")
+ INTEGER = _PropertyTypeInfo(True, "INTEGER")
+ INT64 = _PropertyTypeInfo(True, "INT64")
+ DOUBLE = _PropertyTypeInfo(True, "DOUBLE")
+ BOOLEAN = _PropertyTypeInfo(True, "BOOLEAN")
+ STRING = _PropertyTypeInfo(True, "STRING")
+ ENUM = _PropertyTypeInfo(False, "ENUM")
+ ARRAY = _PropertyTypeInfo(False, "ARRAY")
+ REF = _PropertyTypeInfo(False, "REF")
+ CHOICES = _PropertyTypeInfo(False, "CHOICES")
+ OBJECT = _PropertyTypeInfo(False, "OBJECT")
+ FUNCTION = _PropertyTypeInfo(False, "FUNCTION")
+ BINARY = _PropertyTypeInfo(False, "BINARY")
+ ANY = _PropertyTypeInfo(False, "ANY")
+ ADDITIONAL_PROPERTIES = _PropertyTypeInfo(False, "ADDITIONAL_PROPERTIES")
def UnixName(name):
"""Returns the unix_style name for a given lowerCamelCase string.