Giter VIP home page Giter VIP logo

Comments (5)

Dantevg avatar Dantevg commented on August 24, 2024 2

Well it has been a while. This is a feature that requires a lot of time so I thought I'd give a kind of status update.

I want to avoid changing the communication protocol because of backwards compatibility (I think that atm, you can use any version of the web files with any plugin version). Testing will reveal whether that is actually necessary.

The idea of showing only the top-100 is already implemented locally (haven't committed yet), and that already fixes the general browser lag. For the lag when sorting, I have two options I will be trying, in order:

  1. Optimise sorting in js. Change in communication is not necessary but may improve performance further
  2. Pre-sort all stats/columns on server. Requires a non-backwards-compatible change in the communication protocol. Since this just moves the performance hit to the server, some extra things are needed to prevent causing server lag:
    • Cache stats and sorting server-side: don't re-sort data for 30 seconds or so
    • Custom sorting algorithm that takes advantage of the fact that only stats for online players need to be re-sorted

So things are coming, but they will take some time 😊

from webstats.

coco0325 avatar coco0325 commented on August 24, 2024 1

It works very well. Thank you!

from webstats.

Dantevg avatar Dantevg commented on August 24, 2024

Heyo!

Thanks for the suggestion. I'm not quite sure what you mean though. Currently you can sort by clicking on any stat's header, that way you can see who are the top players for a given stat.
Do you mean that it would indicate where the top-100 ends, and give every player an index (1 to 100)?

And with sheets, do you mean dividing them up in pages, like with < prev and next > controls?

Thank you for the tip on https! If I read things correctly, doing reverse proxy is something that needs to be set up manually in the web server configuration right? I would want to support https automatically in-plugin, but adding a note about reverse proxy to the readme can be a nice first step! (once I read into it a bit more)

from webstats.

coco0325 avatar coco0325 commented on August 24, 2024

The main issue I encountered is on the MySQL function. For example, I want to display the players' stats in a relatively large table (more than 10k rows). The page will contain too much data and cause the browser to lag. If the plugin can pre-sort the stats and only send the top players' data, then the issue can be solved. However, this solution might force the site to display different stats in different sheets.

And yes, the following code is an example.

location /stats.json {
          proxy_pass http://ip:port/stats.json;
}

location /online.json {
          proxy_pass http://ip:port/online.json;
}

from webstats.

Dantevg avatar Dantevg commented on August 24, 2024

It turns out that the first option was already enough and it was not necessary to change the communication protocol 🎉!
Here are the things that changed to improve performance (roughly ordered from most to least performance impact):

  • Add pagination, by default only show 100 players at a time
  • Optimise sorting method
  • Add option to hide player heads
  • When showing player heads, do not load images on hidden pages

You can use the latest js and html files which work just fine with the current jar and performance should be good now! I tested with 10k randomly generated entries on my laptop and the page was pretty responsive, let me know if it works for you as well!

from webstats.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.