How many times is require_once and include_once called with drupal_get_path() ?

As mentioned in #235459: add leading period+slash to views_include() and, for example, on http://reinholdweber.com/?p=3, using a full path, resp. absolutely defined relative path, avoids file lookups in all PHP include directories. So, why aren't we doing this by default?

CommentFileSizeAuthor
#1 drupal.get-path.patch925 bytessun
drupal.get-path.patch575 bytessun

Comments

sun’s picture

StatusFileSize
new925 bytes

OTOH, turning this into a statically cached variable might be more Drupalish.

sun’s picture

Title: Return full path for drupal_get_path() » Return full path for drupal_get_path()/drupal_get_filename()

drupal_get_filename() is what actually needs to be changed here.

Whew... this seems to work in Drupal 5 already. :)

sun’s picture

Benchmark on Drupal 6 with all core modules and a bunch of contrib modules enabled, and caching disabled:

Before this patch:

Benchmarking drupal6.test (be patient).....done


Server Software:        Apache/2.0
Server Hostname:        drupal6.test
Server Port:            80

Document Path:          /
Document Length:        11042 bytes

Concurrency Level:      10
Time taken for tests:   70.824499 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      1152500 bytes
HTML transferred:       1104200 bytes
Requests per second:    1.41 [#/sec] (mean)
Time per request:       7082.450 [ms] (mean)
Time per request:       708.245 [ms] (mean, across all concurrent requests)
Transfer rate:          15.88 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   14  13.4     15      78
Processing:  4812 6899 676.6   7046    8047
Waiting:     4781 6872 675.1   7030    8030
Total:       4812 6913 676.9   7077    8062

Percentage of the requests served within a certain time (ms)
  50%   7077
  66%   7280
  75%   7374
  80%   7437
  90%   7671
  95%   7858
  98%   7968
  99%   8062
 100%   8062 (longest request)

After this patch:

Benchmarking drupal6.test (be patient).....done


Server Software:        Apache/2.0
Server Hostname:        drupal6.test
Server Port:            80

Document Path:          /
Document Length:        11042 bytes

Concurrency Level:      10
Time taken for tests:   66.59118 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      1152500 bytes
HTML transferred:       1104200 bytes
Requests per second:    1.51 [#/sec] (mean)
Time per request:       6605.912 [ms] (mean)
Time per request:       660.591 [ms] (mean, across all concurrent requests)
Transfer rate:          17.03 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   10   8.6     15      31
Processing:  2406 6450 1290.4   7094    8608
Waiting:     2374 6421 1292.5   7077    8577
Total:       2421 6460 1290.5   7109    8608

Percentage of the requests served within a certain time (ms)
  50%   7109
  66%   7421
  75%   7530
  80%   7608
  90%   7812
  95%   7874
  98%   8171
  99%   8608
 100%   8608 (longest request)
sun’s picture

Status: Needs review » Fixed

pwolanin has been so kind to point me to http://api.drupal.org/api/function/module_load_include/6 ...

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.