test-prof / test-prof-mastodon-ai-playground

TestProf AI vs. Mastodon demo
GNU Affero General Public License v3.0
0 stars 0 forks source link

[TestProf] Optimize requests/accounts spec #3

Open palkan opened 3 months ago

palkan commented 3 months ago

File path

./spec/requests/accounts_spec.rb

github-actions[bot] commented 3 months ago

🤖 I'm on it! Let me first collect some profiles for spec/requests/accounts_spec.rb.

github-actions[bot] commented 3 months ago

🤖 Okay, here is the baseline information for spec/requests/accounts_spec.rb:

[TEST PROF INFO] FactoryProf enabled (simple mode)
[TEST PROF INFO] RSpecDissect enabled

Run options: exclude {:streaming=>true, :search=>true, :js=>true}

Randomized with seed 30481

Progress: |====================================================================|
[TEST PROF INFO] RSpecDissect report

Total time: 00:10.309

Total `let` time: 00:05.489
Total `before(:each)` time: 00:09.258

Top 5 slowest suites (by `let` time):

Accounts show response (./spec/requests/accounts_spec.rb:5) – 00:05.489 of 00:10.309 (22)
 ↳ account – 93
 ↳ status_media – 42
 ↳ status_private – 42

Top 5 slowest suites (by `before(:each)` time):

Accounts show response (./spec/requests/accounts_spec.rb:5) – 00:09.258 of 00:10.309 (22)

Finished in 10.86 seconds (files took 16.76 seconds to load)
22 examples, 0 failures

Randomized with seed 30481
[TEST PROF INFO] Factories usage

 Total: 241
 Total top-level: 241
 Total time: 00:06.006 (out of 00:23.723)
 Total uniq factories: 5

   name                    total   top-level     total time      time per call      top-level time

   status                    193         193        3.9232s            0.0203s             3.9232s
   account                    25          25        1.4652s            0.0586s             1.4652s
   media_attachment           19          19        0.5313s            0.0280s             0.5313s
   tag                         3           3        0.0612s            0.0204s             0.0612s
   user                        1           1        0.0258s            0.0258s             0.0258s
github-actions[bot] commented 3 months ago

🤖 I'm on it! Let me first collect some profiles for spec/requests/accounts_spec.rb.

github-actions[bot] commented 3 months ago

🤖 Okay, here is the baseline information for spec/requests/accounts_spec.rb:

[TEST PROF INFO] FactoryProf enabled (simple mode)
[TEST PROF INFO] RSpecDissect enabled

Run options: exclude {:streaming=>true, :search=>true, :js=>true}

Randomized with seed 44833

Progress: |====================================================================|
[TEST PROF INFO] RSpecDissect report

Total time: 00:10.845

Total `let` time: 00:05.482
Total `before(:each)` time: 00:09.586

Top 5 slowest suites (by `let` time):

Accounts show response (./spec/requests/accounts_spec.rb:5) – 00:05.482 of 00:10.845 (22)
 ↳ account – 93
 ↳ status_media – 42
 ↳ status_private – 42

Top 5 slowest suites (by `before(:each)` time):

Accounts show response (./spec/requests/accounts_spec.rb:5) – 00:09.586 of 00:10.845 (22)

Finished in 11.42 seconds (files took 17.51 seconds to load)
22 examples, 0 failures

Randomized with seed 44833
[TEST PROF INFO] Factories usage

 Total: 241
 Total top-level: 241
 Total time: 00:06.025 (out of 00:24.625)
 Total uniq factories: 5

   name                    total   top-level     total time      time per call      top-level time

   status                    193         193        3.9063s            0.0202s             3.9063s
   account                    25          25        1.4831s            0.0593s             1.4831s
   media_attachment           19          19        0.5626s            0.0296s             0.5626s
   tag                         3           3        0.0426s            0.0142s             0.0426s
   user                        1           1        0.0309s            0.0309s             0.0309s