Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance #372

Closed
jpsim opened this issue Nov 16, 2015 · 4 comments
Closed

Improve performance #372

jpsim opened this issue Nov 16, 2015 · 4 comments

Comments

@jpsim
Copy link
Collaborator

jpsim commented Nov 16, 2015

From #370:

However, PSPDFKit really highlights that jazzy needs some performance optimizations to handle larger projects gracefully. Generating docs for your project takes ~50 seconds on my Macbook Pro!

The silver lining of this is that we've never done much profiling or optimization before, so there must be lots of low hanging fruit that we could tackle to improve the situation.

@jpsim
Copy link
Collaborator Author

jpsim commented Nov 16, 2015

I ran ruby-prof on jazzy documenting PSPDFKit and, surprise surprise, a lot of time is spent generating Markdown: https://gist.github.com/jpsim/ad0a65f140e03c35d75b.

Here are the top 15 offenders, accounting for 55% of total time:

 %self      total      self      wait     child     calls  name
  9.85     36.837    25.013     0.000    11.823  3645677   Mustache::Context#find
  5.60     65.352    14.225     0.000    51.127  1696722   Mustache::Context#escapeHTML
  5.54     67.094    14.063     0.000    53.031  1758783   Mustache::Context#fetch
  5.41     20.330    13.729     0.000     6.601  1696722   CGI::Util#escapeHTML
  4.43     11.256    11.256     0.000     0.000  7502628   Gem::StubSpecification#name
  3.76      9.765     9.558     0.000     0.207     9361  *BasicObject#instance_eval
  3.22      8.167     8.167     0.000     0.000 32906551   Kernel#is_a?
  2.85     27.580     7.250     0.000    20.330  1696722   Mustache#escapeHTML
  2.79      8.904     7.095     0.000     1.810  1768769  *String#gsub
  2.41      6.133     6.133     0.000     0.000   582521   Array#shift
  2.13      5.413     5.406     0.000     0.007     4452   SQLite3::Statement#step
  2.13      6.494     5.398     0.000     1.097   578638   Mustache::Context#push
  1.82      4.621     4.621     0.000     0.000  3793675   BasicObject#!
  1.58      4.012     4.011     0.001     0.000     1746   IO#close
  1.36      3.451     3.451     0.000     0.000  1793626   String#to_s

@pigeondev2 pigeondev2 self-assigned this Nov 23, 2016
@pigeondev2
Copy link
Contributor

Any progress on this?

@jpsim
Copy link
Collaborator Author

jpsim commented Nov 26, 2016

No progress to report. One way to improve performance might be to avoid ruby when generating the Mustache templates or Markdown. Then again, these libraries are broadly used and have surely been optimized, so maybe not.

@pigeondev2 pigeondev2 removed their assignment Nov 22, 2021
@johnfairh
Copy link
Collaborator

I'm going to cancel this one now given the stage of jazzy's lifecycle and lack of any further problem reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants