            (map scalar-schema-generator)
            (tc.gen/one-of))))
 
+  (def ^:const scalar-schema-size 1)
+  (def ^:const max-schema-size 1000)
+  (def ^:const coll-schema-size-multiplier 30)
+
+  (defmulti schema-size
+    compiler.schema/schema-name
+    :hierarchy #'compiler.schema/extended-hierarchy)
+
+  (defmethod schema-size :scalar [_]
+    scalar-schema-size)
+
+  (defmethod schema-size :optional [[_ _ schema']]
+    (schema-size schema'))
+
+  (defmethod schema-size :wrapped [[_ _ _ _ schema']]
+    (schema-size schema'))
+
+  (defmethod schema-size :multi [[_ _ _ schema']]
+    (schema-size schema'))
+
+  (defmethod schema-size :coll [[_ _ schema']]
+    (* coll-schema-size-multiplier (schema-size schema')))
+
+  (defmethod schema-size :map [[_ _ key-schema' value-schema']]
+    (* coll-schema-size-multiplier (+ (schema-size key-schema')
+                                      (schema-size value-schema'))))
+
+  (defmethod schema-size :record [[_ _ schemas']]
+    (->> schemas'
+         (vals)
+         (map schema-size)
+         (reduce +)))
+
+  (defmethod schema-size :tuple [[_ _ schemas']]
+    (->> schemas'
+         (map schema-size)
+         (reduce +)))
+
   (def schema-generator
     (tc.gen/such-that (fn [schema]
-                        true) ;; TODO
+                        (< (schema-size schema) max-schema-size))
                       schema-generator*))
-
-  (tc.gen/sample schema-generator)
 
   (defmulti value-generator
     compiler.schema/schema-name

  (defmethod compound-schema-generator :record [_ inner-generator]
    (tc.gen/fmap (fn [schemas]
                   [:record {} schemas])
                 (tc.gen/map tc.gen/keyword inner-generator)))

  (defmethod compound-schema-generator :tuple [_ inner-generator]
    (tc.gen/fmap (fn [schemas]

    (tc.gen/return nil))

  (defmethod value-generator :binary [_]
    (tc.gen/fmap processor.common/byte-seq->binary
                 (tc.gen/vector (tc.gen/large-integer* (bounds 1 true)))))

  (defmethod value-generator :string [_]
    simple-string-generator)

  (defmethod value-generator :keyword [_]
    simple-keyword-generator)

  (defmethod value-generator :symbol [_]
    simple-symbol-generator)

  (defmethod value-generator :any [_]
    (tc.gen/return nil))
