Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
80aacdb0
Commit
80aacdb0
authored
Feb 24, 2011
by
Dries
Browse files
- Patch
#1064212
by catch: page caching performance has regressed by 30-40%.
parent
b3094a0b
Changes
3
Hide whitespace changes
Inline
Side-by-side
includes/cache.inc
View file @
80aacdb0
...
...
@@ -325,10 +325,15 @@ function getMultiple(&$cids) {
try
{
// Garbage collection necessary when enforcing a minimum cache lifetime.
$this
->
garbageCollection
(
$this
->
bin
);
$query
=
db_select
(
$this
->
bin
);
$query
->
fields
(
$this
->
bin
,
array
(
'cid'
,
'data'
,
'created'
,
'expire'
,
'serialized'
));
$query
->
condition
(
$this
->
bin
.
'.cid'
,
$cids
,
'IN'
);
$result
=
$query
->
execute
();
// When serving cached pages, the overhead of using db_select() was found
// to add around 30% overhead to the request. Since $this->bin is a
// variable, this means the call to db_query() here uses a concatenated
// string. This is highly discouraged under any other circumstances, and
// is used here only due to the performance overhead we would incur
// otherwise. When serving an uncached page, the overhead of using
// db_select() is a much smaller proportion of the request.
$result
=
db_query
(
'SELECT cid, data, created, expire, serialized FROM {'
.
db_escape_table
(
$this
->
bin
)
.
'} WHERE cid IN (:cids)'
,
array
(
':cids'
=>
$cids
));
$cache
=
array
();
foreach
(
$result
as
$item
)
{
$item
=
$this
->
prepareItem
(
$item
);
...
...
includes/module.inc
View file @
80aacdb0
...
...
@@ -127,6 +127,9 @@ function system_list($type) {
// if not fetch only the required information to fire bootstrap hooks
// in case we are going to serve the page from cache.
if
(
$type
==
'bootstrap'
)
{
if
(
isset
(
$lists
[
'bootstrap'
]))
{
return
$lists
[
'bootstrap'
];
}
if
(
$cached
=
cache_get
(
'bootstrap_modules'
,
'cache_bootstrap'
))
{
$bootstrap_list
=
$cached
->
data
;
}
...
...
modules/system/system.api.php
View file @
80aacdb0
...
...
@@ -2552,7 +2552,7 @@ function hook_file_load($files) {
*
* @see file_validate()
*/
function
hook_file_validate
(
&
$file
)
{
function
hook_file_validate
(
$file
)
{
$errors
=
array
();
if
(
empty
(
$file
->
filename
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment