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 services/fetch_link_card_service spec #1

Open palkan opened 3 weeks ago

palkan commented 3 weeks ago

File path

./spec/services/fetch_link_card_service_spec.rb

github-actions[bot] commented 3 weeks ago

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

github-actions[bot] commented 3 weeks ago

🤖 Okay, here is the baseline information for spec/services/fetch_link_card_service_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 37144

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

Total time: 00:05.098

Total `let` time: 00:03.151
Total `before(:each)` time: 00:04.838

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

FetchLinkCardService (./spec/services/fetch_link_card_service_spec.rb:5) – 00:03.151 of 00:05.098 (36)
 ↳ html – 72
 ↳ status – 66
 ↳ oembed_cache – 41

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

FetchLinkCardService (./spec/services/fetch_link_card_service_spec.rb:5) – 00:04.838 of 00:05.098 (36)

Finished in 5.76 seconds (files took 16.35 seconds to load)
36 examples, 0 failures

Randomized with seed 37144
[TEST PROF INFO] Factories usage

 Total: 38
 Total top-level: 38
 Total time: 00:03.148 (out of 00:18.176)
 Total uniq factories: 2

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

   status                     36          36        2.2362s            0.0621s             2.2362s
   account                     2           2        0.9118s            0.4559s             0.9118s