Some Structure for MutableType doc paragraph
Issue #1979
resolved
Not sure if I'm using the correct heading markup:
diff -r e15fa0342d2ac83414c563abd8fd478251d4d35f lib/sqlalchemy/types.py
--- a/lib/sqlalchemy/types.py Thu Nov 18 20:12:24 2010 -0500
+++ b/lib/sqlalchemy/types.py Sat Nov 20 11:52:40 2010 +0000
@@ -544,6 +544,9 @@
and compare function for values of this type - implementing
subclasses should override these appropriately.
+ Performance Impact
+ ^^^^^^^^^^^^^^^^^^
+
The usage of mutable types has significant performance
implications when using the ORM. In order to detect changes, the
ORM must create a copy of the value when it is first
@@ -564,6 +567,9 @@
negligible. In most cases it's likely that the convenience allowed
by "mutable" change detection outweighs the performance penalty.
+ Alternative Usage (mutable=False)
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
It is perfectly fine to represent "mutable" data types with the
"mutable" flag set to False, which eliminates any performance
issues. It means that the ORM will only reliably detect changes
Would also be good if under the Alternative section, an example could be added of how to set the flag, e.g.
PickleType(mutable=False)
EoghanM
Comments (3)
-
repo owner -
repo owner - changed status to wontfix
Going to put this ticket as out of date since MutableType is deprecated and we can't really put section headers in docstrings.
-
repo owner - removed milestone
Removing milestone: 0.5.9 (automated comment)
- Log in to comment
unfortunately Sphinx is not allowing section titles there, otherwise I'd put this in. I'm going to be starting with mutable=False in 0.7 (
#1980)