Abnormal cpu usage

TXS - Help
Chris
2013-12-28
2013-12-31
  • Chris

    Chris - 2013-12-28

    I wanted to post in here, before opening a bug report about this issue. I've been noticing, TexStudio has been using some really extensive cpu usage for extended periods. What I am noticing specificaly, is that the program is maintaining full cpu usage for extended periods (at times multiple minutes for simple, opening a regular document, or saving the document).

    Now, the documents I am working on,is more of a collection type. In that I have a central document, including several other sub documents as seperate chapters (independent of each other). The makeup of the documents are all regular text style, no special fields, very few custom macros (specificaly, I only have 2 macros defined, in the root/central document), otherwise simple/regular latex commands like textbf/ldots/and the occational character escapes (like the '$' and '&' signs).

    What I have seen, from rough timing, and testing. When I open a fairly large document (file size was 3.2M, about 67k lines); the program maintained nearly 3 minutes of full cpu usage (the exact time I got was about 2 minutes and 45 seconds). The only documents open prior to the test was my root/central document only have a total of 180 lines, and that document generaly don't get modified too often (roughly once every few months roughly). When I tried opening a 3rd document (file size was only 25K), the program maintained 2 minutes of cpu usage. All of this, is just opening the douments and waiting, not doing anything cpu/memory intensive on my computer (typicaly most I do is read a web page that is already loaded, while I wait). Now, normaly I wouldn't be concerned as much, if this was just limited when opening the documents, as I can live with that. I have been noticing, there is also significant cpu usage, once I click save after making a change on one of my documents. When I am making changes/saving a document I am only modifing one document at a time, any other documents that was opened prior to making any kind of modifications are left untouched (even, scrolling down/up in it). Sadly, I don't have any measurements in exact times, except visualy it appears to take about the same amount of time when I make a change in the document, as when I first opened it.

    On another side test, I did by just opening a small file (about 20K in file size), besides having the same usual root/central document (the 180 line one). From what I noticed, the load time was about normal like for other text editors, roughly 10-15 seconds (I didn't get too good of measurement on that one). So, from what I can tell; this is mostly affecting large document sizes (I don't have any specifics on size limits at this time). However, it seems like it probably escalates rapidly, larger the file size is opened, longer high cpu usage; (including it leaking into other files loaded afterwards).

    I am running on linux (Gentoo distro), memory usage during the testing was only reported to be about 12% of my total ram, with no swap usage, since my last reboot (uptime over 4 days) I haven't had any swap usage yet; and my cpu usage generaly resting around 1-2%, except when the program was opening/saving the document. Only programs open was only the web browser (firefox), and a couple terminal windows that was inactive (was not being used that the time). I am also certain no other programs are ever touching any files, texstudio was operating with ever. I did turn off the option to silently reload files on external changes.

    emerge -pv texstudio

    These are the packages that would be merged, in order:

    Calculating dependencies... done!
    [ebuild R ] app-office/texstudio-2.6.6 USE="-video" 0 kB

    If anyone has any ideas of any options I should try disabling/enabling or testing something out, feel free to let me know. I've been able to reproduce my results pretty much every time, and I am quite comfortable testing stuff on my computer; and if really need I can see about getting a really big document if I really need to test something really large (I can easily get a file that exceeds 100M if needs be).

     
    • Jan  Sundermeyer

      Jan Sundermeyer - 2013-12-28

      When opening a document three cpu intensive things may happen:

      1) the complete syntax is checked. Normally this won't take long, though
      i don't know about your cpu type

      2) if a reference to a bibtex file is present, that file is scanned

      3) if a usepackage command with an yet unknown package is present in the
      document the package source is scanned. However this only happens once
      as the results are stored and reused the next time.

      As long as txs itself does not freeze, nothing to be concerned about.

      Jan

      On 28.12.2013 07:36, Chris wrote:

      I wanted to post in here, before opening a bug report about this issue.
      I've been noticing, TexStudio has been using some really extensive cpu
      usage for extended periods. What I am noticing specificaly, is that the
      program is maintaining full cpu usage for extended periods (at times
      multiple minutes for simple, opening a regular document, or saving the
      document).

      Now, the documents I am working on,is more of a collection type. In that
      I have a central document, including several other sub documents as
      seperate chapters (independent of each other). The makeup of the
      documents are all regular text style, no special fields, very few custom
      macros (specificaly, I only have 2 macros defined, in the root/central
      document), otherwise simple/regular latex commands like textbf/ldots/and
      the occational character escapes (like the '$' and '&' signs).

      What I have seen, from rough timing, and testing. When I open a fairly
      large document (file size was 3.2M, about 67k lines); the program
      maintained nearly 3 minutes of full cpu usage (the exact time I got was
      about 2 minutes and 45 seconds). The only documents open prior to the
      test was my root/central document only have a total of 180 lines, and
      that document generaly don't get modified too often (roughly once every
      few months roughly). When I tried opening a 3rd document (file size was
      only 25K), the program maintained 2 minutes of cpu usage. All of this,
      is just opening the douments and waiting, not doing anything cpu/memory
      intensive on my computer (typicaly most I do is read a web page that is
      already loaded, while I wait). Now, normaly I wouldn't be concerned as
      much, if this was just limited when opening the documents, as I can live
      with that. I have been noticing, there is also significant cpu usage,
      once I click save after making a change on one of my documents. When I
      am making changes/saving a document I am only modifing one document at a
      time, any other documents that was opened prior to making any kind of
      modifications are left untouched (even, scrolling down/up in it). Sadly,
      I don't have any measurements in exact times, except visualy it appears
      to take about the same amount of time when I make a change in the
      document, as when I first opened it.

      On another side test, I did by just opening a small file (about 20K in
      file size), besides having the same usual root/central document (the 180
      line one). From what I noticed, the load time was about normal like for
      other text editors, roughly 10-15 seconds (I didn't get too good of
      measurement on that one). So, from what I can tell; this is mostly
      affecting large document sizes (I don't have any specifics on size
      limits at this time). However, it seems like it probably escalates
      rapidly, larger the file size is opened, longer high cpu usage;
      (including it leaking into other files loaded afterwards).

      I am running on linux (Gentoo distro), memory usage during the testing
      was only reported to be about 12% of my total ram, with no swap usage,
      since my last reboot (uptime over 4 days) I haven't had any swap usage
      yet; and my cpu usage generaly resting around 1-2%, except when the
      program was opening/saving the document. Only programs open was only the
      web browser (firefox), and a couple terminal windows that was inactive
      (was not being used that the time). I am also certain no other programs
      are ever touching any files, texstudio was operating with ever. I did
      turn off the option to silently reload files on external changes.

      emerge -pv texstudio

      These are the packages that would be merged, in order:

      Calculating dependencies... done!
      [ebuild R ] app-office/texstudio-2.6.6 USE="-video" 0 kB

      If anyone has any ideas of any options I should try disabling/enabling
      or testing something out, feel free to let me know. I've been able to
      reproduce my results pretty much every time, and I am quite comfortable
      testing stuff on my computer; and if really need I can see about getting
      a really big document if I really need to test something really large (I
      can easily get a file that exceeds 100M if needs be).


      Abnormal cpu usage
      https://sourceforge.net/p/texstudio/discussion/907840/thread/7ef2fffc/?limit=25#83a2


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/texstudio/discussion/907840/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Jan  Sundermeyer

    Jan Sundermeyer - 2013-12-28

    When opening a document three cpu intensive things may happen:

    1) the complete syntax is checked. Normally this won't take long, though
    i don't know about your cpu type

    2) if a reference to a bibtex file is present, that file is scanned

    3) if a usepackage command with an yet unknown package is present in the
    document the package source is scanned. However this only happens once
    as the results are stored and reused the next time.

    As long as txs itself does not freeze, nothing to be concerned about.

    Jan

     
  • Chris

    Chris - 2013-12-28

    Ok, that may explain the extensive cpu usage whenn I open a document up, as I know for sure I don't have any bibtex references used (not even installed on my computer). The usepackage shouldn't be an issue as I only have it in my root document, all other documents are included from that specific one. I'll accept the syntex checking, the other conern then why would it be redoing the syntex checking all over on the document every time I save it. Assuming that is what it is doing when ever I save a small change in a document.

     
  • Tim Hoffmann

    Tim Hoffmann - 2013-12-28

    Indeed, syntax checking is currently repeated after a save operation. It's probably not required in most situations but we'd need to investigate more closely.

    Does the performance improve if you uncheck Options -> Editor -> Inline Checking -> Syntax (you need to have advanced options enabled to see it)?

     
  • Chris

    Chris - 2013-12-28

    Yes I did see a significant performance improvement, on both when I first open a document, and after I made a couple changes in the document. I performed all of this on one of my larger documents, a 3.2M file. To give me a reference from before hand. From what I noticed, the time dropped from the nearly 3 minute of cpu usage to roughly about 10 seconds on loading. Performing a save after making some changes in the same file I opened, also had a huge improvement in performance, with a cpu usage of around 5 seconds or less. So there is a significant improvement there too.

    None of my documents have any significant syntax; if anything across most of my documents I generaly use the same 5-7 commands ever; most is regular text only, with no tables, graphics, or even changes in font changes (besides textbf/textit).

    For me, the syntax checking is of little concern overall; as it usualy didn't do anything for me. The most times, there was a syntax issue; I either catch it before I compile, or the compiler throws a error/warning up to me. The usual issues I ever encounter is the bad box warning or invalid command (usualy forgetting to space after the \ldots, and that change is usual done by a find/replace so I usualy don't stay in that one spot too long to catch it).

    Let me know if you want to test anything else (I have no problem of compiling the program if you want to make a change in the code). Otherwise I am happy with how the program is working now with the syntax checking disabled.

     
  • Tim Hoffmann

    Tim Hoffmann - 2013-12-31

    I've fixed syntax checking on save (It will not be performed anymore except if there are any diffs which need cleanup).

    hg 4211 (58acd404250a)

    This should give you reasonable save performance also with syntax checking enabled in the options.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks