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

Performance problem - Stress Testing #6

Open
titombo opened this issue Dec 7, 2013 · 3 comments
Open

Performance problem - Stress Testing #6

titombo opened this issue Dec 7, 2013 · 3 comments

Comments

@titombo
Copy link

titombo commented Dec 7, 2013

I used your method for 3004 paragraphs in a text, check the javaScript bellow:

<script>

  disqus_shortname = 'myShortNameDisqus';
  jQuery(document).ready(function () {

     // jQuery("p"); returns 3004 elements
      jQuery("p").inlineDisqussions(
          {
              position: 'right',
              displayCount: false
          }
          );
  });
</script>

http://cfcomentada.azurewebsites.net/
It took 25 seconds to execute.
Is there a way to make the execution quicker ?
Since this page is not gonna change, maybe there is a way to store the
per-proccessing somewhere.

Is this generated each time it runs the script ?
http://cfcomentada.azurewebsites.net/js?v=rHWjXiMtWOTPjhUf3vKK52W1uMgkpJt0Wyh5RANE5MQ1

Thanks for the API, is helping a lot. 👍 :)

@tsi
Copy link
Owner

tsi commented Dec 7, 2013

The only thing that can cause such execution time is the script that fetches the comments count from Disqus to display them besides the paragraphs (the actual comment threads are not being pre-fetched).
You can prevent this script from running by passing displayCount: false in your settings object. you won't be able to display the comment count though.

@titombo
Copy link
Author

titombo commented Dec 7, 2013

But already is set to '''displayCount: false''', check the code I just sent on the comment before.

Probably is one of these document.createElement.
It generates this kind of script, and there is a repetition, maybe it can concatenate, here is an example of script that is gereated:

http://cfcomentada.azurewebsites.net/js?v=rHWjXiMtWOTPjhUf3vKK52W1uMgkpJt0Wyh5RANE5MQ1/event/seq/1/anonymous

function (n){return typeof i===o||n&&i.event.triggered===n.type?t:i.event.dispatch.apply(l.elem,arguments)}
function (n,i,u){return null==n||"boolean"==typeof n?r.apply(this,arguments):this.animate(vt(t,!0),n,i,u)}
function (n,i,u){return null==n||"boolean"==typeof n?r.apply(this,arguments):this.animate(vt(t,!0),n,i,u)}
function (n){return typeof i===o||n&&i.event.triggered===n.type?t:i.event.dispatch.apply(l.elem,arguments)}
function (n){return typeof i===o||n&&i.event.triggered===n.type?t:i.event.dispatch.apply(l.elem,arguments)}
function (n){return typeof i===o||n&&i.event.triggered===n.type?t:i.event.dispatch.apply(l.elem,arguments)}
function (n){return typeof i===o||n&&i.event.triggered===n.type?t:i.event.dispatch.apply(l.elem,arguments)}
function (n){return typeof i===o||n&&i.event.triggered===n.type?t:i.event.dispatch.apply(l.elem,arguments)}
function (n){return typeof i===o||n&&i.event.triggered===n.type?t:i.event.dispatch.apply(l.elem,arguments)}
function (n){return typeof i===o||n&&i.event.triggered===n.type?t:i.event.dispatch.apply(l.elem,arguments)}
function (n){return typeof i===o||n&&i.event.triggered===n.type?t:i.event.dispatch.apply(l.elem,arguments)}
function (n){return typeof i===o||n&&i.event.triggered===n.type?t:i.event.dispatch.apply(l.elem,arguments)}

It seems that create.Element is better even than an equivalent jQuery method.
http://stackoverflow.com/questions/268490/jquery-document-createelement-equivalent

@titombo
Copy link
Author

titombo commented Dec 8, 2013

Is there a way to reuse the javaScript code that was already generated, without needing to generate it again ?
Maybe a new parameter on the constructor.

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

No branches or pull requests

2 participants