Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #4174 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

[PPATCH] performance speedup for ActionController

Reported by: skaes Assigned to: David
Priority: normal Milestone: 1.1
Component: ActionPack Version: 1.0.0
Severity: normal Keywords: performance
Cc:

Description

This relatively small patch yields a significant speedup for my aplication. After its application, trunk performance will be slightly better than 1.0 performance.

For my app, I have measured the following speed difference against current trunk:

perf data file 1: 03-10.all.trunkc
  requests=5000, options=-bm=all -mysql_session -fast_routes -fast_readers -OT -lib=trunkc

perf data file 2: 03-10.all.trunkcl
  requests=5000, options=-bm=all -mysql_session -fast_routes -fast_readers -OT -lib=trunkcl

page   c1 real   c2 real  c1 r/s  c2 r/s  c1 ms/r  c2 ms/r  c1/c2
 1:    7.04648   6.99902   709.6   714.4     1.41     1.40   1.01
 2:    8.29232   8.26888   603.0   604.7     1.66     1.65   1.00
 3:    8.75548   8.67792   571.1   576.2     1.75     1.74   1.01
 4:    8.92996   8.86846   559.9   563.8     1.79     1.77   1.01
 5:   18.81516  18.08453   265.7   276.5     3.76     3.62   1.04
 6:   23.33968  22.74193   214.2   219.9     4.67     4.55   1.03
 7:   23.98835  23.33545   208.4   214.3     4.80     4.67   1.03
 8:   23.54084  22.78310   212.4   219.5     4.71     4.56   1.03

urls:
 1: /empty/index
 2: /welcome/index
 3: /rezept/index
 4: /rezept/myknzlpzl
 5: /rezept/show/713
 6: /rezept/cat/Hauptspeise
 7: /rezept/cat/Hauptspeise?page=5
 8: /rezept/letter/G

Compared to Rails 1.0:

perf data file 1: 03-10.all.stable
  requests=5000, options=-bm=all -mysql_session -fast_routes -fast_readers -OT -lib=stable

perf data file 2: 03-10.all.trunkcl
  requests=5000, options=-bm=all -mysql_session -fast_routes -fast_readers -OT -lib=trunkcl

page   c1 real   c2 real  c1 r/s  c2 r/s  c1 ms/r  c2 ms/r  c1/c2
 1:    7.39998   6.99902   675.7   714.4     1.48     1.40   1.06
 2:    8.14989   8.26888   613.5   604.7     1.63     1.65   0.99
 3:    8.63355   8.67792   579.1   576.2     1.73     1.74   0.99
 4:    8.64721   8.86846   578.2   563.8     1.73     1.77   0.98
 5:   19.40646  18.08453   257.6   276.5     3.88     3.62   1.07
 6:   23.08732  22.74193   216.6   219.9     4.62     4.55   1.02
 7:   23.70789  23.33545   210.9   214.3     4.74     4.67   1.02
 8:   23.00868  22.78310   217.3   219.5     4.60     4.56   1.01

Attachments

ap_speedup_for_1_1.patch (16.2 kB) - added by skaes on 03/10/06 16:24:02.
ap_speedup_for_1_1.2.patch (18.0 kB) - added by skaes on 03/13/06 10:55:10.
updated for changeset 3860
ap_speedup_for_1_1.3.patch (13.1 kB) - added by skaes on 03/18/06 19:28:12.
updated upon dhh's request

Change History

03/10/06 16:24:02 changed by skaes

  • attachment ap_speedup_for_1_1.patch added.

03/13/06 10:55:10 changed by skaes

  • attachment ap_speedup_for_1_1.2.patch added.

updated for changeset 3860

03/13/06 11:30:05 changed by skaes

New benchmark data after adapting to 3860, and changing my app slightly:

perf data file 1: 03-13.all.stable
  requests=5000, options=-bm=all -mysql_session -fast_routes -fast_readers
                         -no_ctf -OT -lib=stable

perf data file 2: 03-13.all.trunkcl
  requests=5000, options=-bm=all -mysql_session -fast_routes -fast_readers
                         -no_ctf -OT -lib=trunkcl

page   c1 real   c2 real  c1 r/s  c2 r/s  c1 ms/r  c2 ms/r  c1/c2
 1:    7.55471   7.07179   661.8   707.0     1.51     1.41   1.07
 2:    8.22092   8.30912   608.2   601.7     1.64     1.66   0.99
 3:    8.73767   8.87266   572.2   563.5     1.75     1.77   0.98
 4:    8.79868   8.71276   568.3   573.9     1.76     1.74   1.01
 5:   19.49658  18.49459   256.5   270.3     3.90     3.70   1.05
 6:   23.28924  22.84404   214.7   218.9     4.66     4.57   1.02
 7:   23.78998  23.46598   210.2   213.1     4.76     4.69   1.01
 8:   23.19496  22.95929   215.6   217.8     4.64     4.59   1.01

03/18/06 19:28:12 changed by skaes

  • attachment ap_speedup_for_1_1.3.patch added.

updated upon dhh's request

03/20/06 04:01:14 changed by david

  • status changed from new to closed.
  • resolution set to fixed.

(In [3989]) Performance speedup for ActionController (closes #4174) [Stefan Kaes] Includes caching of filter chains -- be on the lookout for problems with that!