Skip to content

Performance problem - Stress Testing #6

Open

Description

@titombo

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. 👍 :)

Activity

  1. tsi commented on Dec 7, 2013

    @tsi
    Owner

    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.

  2. titombo commented on Dec 7, 2013

    @titombo
    Author

    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

  3. titombo commented on Dec 8, 2013

    @titombo
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions