DICE PACKS BUNDLE
  1. #1

    I have noticeable input lag when dealing with large story entries

    I've been converting Arden Vul for my home game and have had some story entries that are occasionally pretty large. Sometimes I've noticed input lag while typing... and occasionally it even seemed to miss characters now and then when it lagged, though it's hard to prove that isn't just a typo occurring at the same time. Scrolling larger story entries "chugs" a little bit too. Nothing really unmanageable, but noticeable and undesirable.

    In an attempt to show this more perceptibly, I've recorded some stats on what I'm seeing when dealing with a fresh CoreRPG campaign, no modules or extensions loaded.

    1. Create a new Core RPG campaign. RAM usage is currently about 246 MB.
    2. Create a new story entry. RAM use is about 258.8 MB now.
    3. Add 100 KB worth of "The quick brown fox jumped over the lazy dogs." to the story entry. (conveniently attached to this post as qbf.txt!)
    4. Manually type in a few words. The input lag is very noticeable with a story entry this size. After typing a sentence or two and scrolling the story entry (which is also laggy), memory usage was at 920 MB.
    5. Add another new story entry while the first (large) one is still open. Memory usage now at 930 MB.
    6. Type in that new entry. No lag in that entry. Very responsive. Original, large entry still very laggy though.
    7. Closing the story entry doesn't immediately return the memory, but that's not surprising. Garbage collection happens when it happens.
    8. Closing the campaign and returning to the launcher also doesn't return the memory.
    9. Opening the campaign again, going to that story, and opening it and scrolling shoots memory usage up to 1438 MB.
    10. Closing that story entry and reopening it and scrolling brings memory usage to 1896 MB.
    11. I repeated step 10 for a while until I got go 2590 MB used.
    12. Returned to the launcher, memory still in use.

    I understand 100 KB of "the quick brown fox jumped over the lazy dogs" is not a realistic scenario. However, I'm reporting this because I have encountered this with realistic scenarios, and this seemed like the quickest and easiest way to show what's going on. That memory usage seems way out of line for 100 KB worth of text, anyway. I'm reporting it for context on the issue... I'm in no way suggesting that I think the memory is actually what's causing the lag. It just seemed like an unusually high amount (~450 MB for a 100 KB story entry). However, as mentioned, the application still runs fine with smaller story entries open at the same time. It's only the large one that experiences lag.

    It's possible that linked records or text formatting (such as tables) in the story exacerbates the problem, as in my "real" scenarios, I'm often dealing with those. I will dive into some of my already-created module entries to see if I can find the "realistic" cases where I was definitely seeing this happen, but in the meantime, this example seemed useful.

    Note: After testing this a bit more, it seems like scrolling with the scroll wheel, rather than clicking on the scroll bar and moving it, seems worse, both in terms of noticeable lag and in terms of watching memory usage shoot up. Memory usage also seems to stop bloating around 2.7GB and actually sometimes goes down at that point, so I'm guessing it's just the OS not freeing up memory until it needs to.
    Attached Files Attached Files
    Last edited by Sterno; December 1st, 2021 at 17:54.

  2. #2
    I noticed that the RAM usage (which again, I'm not saying is responsible for the lag!) has a lot more to do with scrolling the entry than anything else. Was able to get memory usage up to 2.5 GB with just a single "quick brown fox" 100 KB story entry by scrolling it in a brand new campaign. It seems to stabilize there.


  3. #3
    Thanks for the detailed steps and example to recreate. I'll be away for about a week; but I'll try and schedule some time when I get back to see if I can find anything that stands out.

    Regards,
    JPG

  4. #4
    Just to back up Sterno on this one I also have noticed this while building a reference manual the old way.

  5. #5
    This behaves very similar to how the chat input get more sluggish the longer the text is pasted in. It also behaves similar to the sorted feats list windows in PF2 in that the longer the Story entry the higher the CPU load and corresponding FPS drop for both scrolling and just moving the window around. Seems like we need page controls for long story entries to workaround the bottleneck.

  6. #6
    @Weissrolf,

    Assuming that a separate issue is related when you have no data or knowledge of the code and making snarky comments about potential solutions neither helps identify the issue or provide any positive value to this thread. Please refrain from posting in other people's support threads.

    Thanks,
    JPG

  7. #7
    Actually I specifically tested this before posting. The longer the pasted text the worse the choppiness and the more the frame-rate drop when scrolling and moving the window. Same for a connected player that opens the shared story entry. You might be able to find a correlation between the text length and and lag (processing) time. But of course I had no data other than that before I posted, next time I should run the software through a disassembler first.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in