just discovered that the CGI::Cookie class has a major impact on
performance.
When using it, ab gives me (using fcgi/apache 1.3)
40.85 Requests / second
when simplifying the initialization of CGI::Cookie (see below), its 3 times
faster:
124.64 Requests / second
Perhaps someone should dig in this. It seems to be related to the
SimpleDelegator superclassing (though I don't see why delegating should be
necessary here, the simplification seems to work fine).
benny
···
--
class CGI
class Cookie
def initialize(options)
unless options.has_key?("name")
raise ArgumentError, "`name' required"
end
# simple support for IE
if options["path"] @path = options["path"]
else
%r|^(.*/)|.match(ENV["SCRIPT_NAME"]) @path = ($1 or "")
end
@domain = options["domain"] @expires = options["expires"] @secure = options["secure"] == true ? true : false
end
end
end
--
---------------------------------------------------------------------------------------------------
Don't crash when a filter changes the subject of a message which results
in the attempt to remove it from the tree of subject threading messages
failing and the detached child looking for a new parent finding the old
parent as the new parent, which in turn results in the child being deleted
with the old (and new) parent, which is not a good idea, since it is
still referenced.
(Till Adams commit on kdepim/kmail/kmheaders.cpp in HEAD, 6. Jan. 2005)
just discovered that the CGI::Cookie class has a major impact on
performance.
When using it, ab gives me (using fcgi/apache 1.3)
40.85 Requests / second
when simplifying the initialization of CGI::Cookie (see below), its 3
times faster:
124.64 Requests / second
Perhaps someone should dig in this. It seems to be related to the
SimpleDelegator superclassing (though I don't see why delegating should be
necessary here, the simplification seems to work fine).
benny
--
class CGI
class Cookie
def initialize(options)
unless options.has_key?("name")
raise ArgumentError, "`name' required"
end
# simple support for IE
if options["path"] @path = options["path"]
else
%r|^(.*/)|.match(ENV["SCRIPT_NAME"]) @path = ($1 or "")
end
@domain = options["domain"] @expires = options["expires"] @secure = options["secure"] == true ? true : false
end
end
end
--
---------------------------------------------------------------------------------------------------
Don't crash when a filter changes the subject of a message which results
in the attempt to remove it from the tree of subject threading messages
failing and the detached child looking for a new parent finding the old
parent as the new parent, which in turn results in the child being deleted
with the old (and new) parent, which is not a good idea, since it is
still referenced.
(Till Adams commit on kdepim/kmail/kmheaders.cpp in HEAD, 6. Jan. 2005)
Perhaps someone should dig in this. It seems to be related to the
SimpleDelegator superclassing (though I don't see why delegating should be
necessary here, the simplification seems to work fine).
I made a post about this before the release of 1.8.2, but unfortunately it didn't make it in for some reason. Rails ships with a cookie_performance_fix.rb[1] file for this very reason. Hopefully this will be picked up and be part of the next release.
Ruby could really use a Trac installation to keep track of patches (and bugs).
Bugs and patches submitted there automatically generate an email to the
ruby-core mailing list...
Yours,
Tom
···
On Wed, 2005-02-09 at 08:22, David Heinemeier Hansson wrote:
> Perhaps someone should dig in this. It seems to be related to the
> SimpleDelegator superclassing (though I don't see why delegating
> should be
> necessary here, the simplification seems to work fine).
I made a post about this before the release of 1.8.2, but unfortunately
it didn't make it in for some reason. Rails ships with a
cookie_performance_fix.rb[1] file for this very reason. Hopefully this
will be picked up and be part of the next release.
Ruby could really use a Trac installation to keep track of patches (and
bugs).