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 models/notification spec #6

Open palkan opened 2 months ago

palkan commented 2 months ago

File path

spec/models/notification_spec.rb

github-actions[bot] commented 2 months ago

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

github-actions[bot] commented 2 months ago

🤖 Okay, here is the baseline information for spec/models/notification_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 44998

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

Total time: 00:12.859

Total `let` time: 00:11.516
Total `before(:each)` time: 00:10.702

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

Notification (./spec/models/notification_spec.rb:5) – 00:11.516 of 00:12.859 (37)
 ↳ notifications – 45
 ↳ subject – 38
 ↳ status – 4

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

Notification (./spec/models/notification_spec.rb:5) – 00:10.702 of 00:12.859 (37)

Finished in 13.55 seconds (files took 16.22 seconds to load)
37 examples, 0 failures

Randomized with seed 44998
[TEST PROF INFO] Factories usage

 Total: 332
 Total top-level: 284
 Total time: 00:11.774 (out of 00:25.919)
 Total uniq factories: 10

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

   notification              149         149        4.4576s            0.0299s             4.4576s
   status                     96          48        4.1515s            0.0432s             1.9138s
   favourite                  16          16        1.0413s            0.0651s             1.0413s
   mention                    16          16        1.0443s            0.0653s             1.0443s
   follow                     15          15        0.8127s            0.0542s             0.8127s
   follow_request             15          15        0.6420s            0.0428s             0.6420s
   poll                       15          15        0.7579s            0.0505s             0.7579s
   account                     8           8        0.8680s            0.1085s             0.8680s
   account_warning             1           1        0.0673s            0.0673s             0.0673s
   report                      1           1        0.1692s            0.1692s             0.1692s