Permalink
Browse files

Add some warnings to the documentation related to Object#extend use

Object#extend busts method caches in MRI and probably other current
ruby implementations, so note usage in the documentation so that
users can be aware of it.
  • Loading branch information...
1 parent b60e7de commit b31e8f683deef1f93c8d59e0f61f37ac80611d09 @jeremyevans committed Jan 7, 2013
@@ -75,6 +75,13 @@ and update queries, the hash to insert/update is passed to +prepare+:
ps2.call(:n=>'Jim', :new_n=>'Bob')
DB.call(:update_name, :n=>'Jim', :new_n=>'Bob') # same as above
+== Implementation Issues
+
+Currently, creating a prepared statement uses Object#extend, which can hurt
+performance. For high performance applications, it's recommended to create
+all of your prepared statements upon application initialization, and not
+to create prepared statements dynamically at runtime.
+
== Database support
=== PostgreSQL
@@ -24,6 +24,8 @@
# dataset and the dataset doesn't have an already cached
# version of the columns, it will create a new dataset with
# the same options to get the columns.
+#
+# This extension uses Object#extend at runtime, which can hurt performance.
module Sequel
class Dataset
@@ -5,6 +5,8 @@
# To load the extension:
#
# Sequel.extension :pagination
+#
+# This extension uses Object#extend at runtime, which can hurt performance.
module Sequel
class Dataset
@@ -5,6 +5,8 @@
# To load the extension, do:
#
# Sequel.extension :query
+#
+# This extension uses Object#extend at runtime, which can hurt performance.
module Sequel
class Database

0 comments on commit b31e8f6

Please sign in to comment.