Tuesday, January 30, 2018

Change Log: 2.67.1287

The optimization project continues! Release 2.67.1287 does not push any new features, but focuses heavily on performance.

Most of the general/non-specific user feedback I've gotten in the last couple of months is about how long the Manager takes when loading a new page or "view".

And while there are certain, critical aspects of load times that I cannot control, such as network conditions, the speed of your client device, etc., there are a few of things that I can control:
  1. the time it takes to render the HTML that constitutes a given "view" (e.g. Dashboard, Survivor Sheet, etc.).
  2. the size of static files, e.g. CSS and JS, that you need to pull down to use that HTML.
  3. the time it takes the API to respond to requests made by that HTML.
The focus of release 2.67.1287 is to massively reduce the time it takes for that first piece to happen, theory being that if the app renders the HTML faster, you can start downloading it that much faster and cut some time from your overall load time.

This is a table that shows the average production render times (in seconds) for the main views in the previous release of the Manager:

dashboard0.66
loginN/A*
new_settlement0.45
view_campaign0.61
view_settlement0.60
view_survivor0.48

* data not available.


And here are the average render times for those same views in 2.67.1287 (again, in seconds):

dashboard0.05
login0.35
new_settlement0.03
view_campaign0.27
view_settlement0.47
view_survivor0.04

They say, in the biz, that one second is what you should be shooting for, in terms of having a view loaded and ready to go for the user. Even on very fast connections, views that used to take more than half a second (on average) to render have no chance of being loaded in one second. 

In 2.67.1287, however, everything gets a lot faster, in terms of how long it takes for view HTML to be created by the web application, and that is an important part of the overall optimization effort.

In related (but probably not as significant) news, when I started working on this release, I found that over 18% of the CSS class selectors used in the project's primary style.css file were not in use.

(To put that another way, before release 2.67.1287, there were something like 80 different selectors that weren't referenced anywhere in any of the project's HTML templates!)

All of which is to say that the HTML, CSS and JS files that you have to pull down when you load a new view should come down just a little bit faster now.

Finally, this release also adds some simple unit testing to the legacy webapp.

One of my 2018 goals for the Manager is to basically lock the legacy webapp down: to "finish" it and stop updating it, so I can focus exclusively on HTML templates and API enhancements. Unit tests are a big part of that: locking down the features of the legacy webapp and wrapping them in unit tests gives me the ability to basically stop active development on it, which is a major goal.

At any rate, I've got some big feature enhancements coming up in the next release, so stay tuned!

Thanks for using the Manager!

Corrections and Fixes

  1. Miscellaneous HTML markup no longer appears in survivor names.
  2. Addressed a tablet-resolution presentation issue where the SotF reroll toggle box presentation looked broken.

Application Enhancements

  1. The Survivor Sheet 'Name' container refreshes immediately upon save with the 'normalized' (e.g. HTML-stripped survivor name).
  2. Changing a survivor's name on the Survivor Sheet no longer reinitializes the sheet.
  3. Added unit testing the the legacy webapp:
    1. Wrote a test that checks the class selectors in style.css versus the legacy webapp HTML template files to see if those selectors are in use anywhere (and fails if it finds abandoned/vestigial class selectors).
    2. Wrote another test that checks the application files in the root project dir to see if they're importing deprecated/banished modules.
  4. Deprecated 21 vestigial CSS class selectors from style.css
  5. assets.py no longer imports:
    1.  world.py (which is deprecated in the legacy webapp).
    2. game_assets.py 
  6. Deprecated the legacy webapp's admin panel:
    1. removed the button from the dashboard
    2. removed the panel class definition from the admin.py file
    3. removed HTML subs related to the panel
  7. Completely deprecated models.py and removed it from the legacy webapp, since literally everything it did is now done in the API. Very nice!
  8. Deprecated the get_game_asset_deck() method from the legacy webapp Settlement class object.
  9. Removed support from the legacy webapp for converting legacy game_assets.py asset dictionaries (since they've all been ported to the API).
  10. Deprecated all "safari_warning" methods and style/HTML code.
  11. Removed support for the "norefresh" POST parameter from the legacy webapp.
  12. Added dev-only page render time logging.
  13. Added utils.on_production() method to quickly test whether we're currently running in production (i.e. or dev).
  14. Refactored index so that it only renders the view once when processing the login; also made the login.render() operation included in debug/dev response time logging.
  15. Deprecated the legacy webapp's login.py AuthObject.authenticate_and_render() method. For sanity/maintainability purposes, we always want html.py to do the renders (i.e. so there's only one way to render HTML).
  16. Removed legacy webapp support for exporting user data (to be replaced by the API).
  17. Moved the "default" UI templates into html.render() so that the render call in index doesn't have to contain what basically amounts to config information.
  18. Created a wrapper for the session.Session.__init__() method called init_failure() (i.e. to replace the try/except code in index).
  19. api.py no longer throws a warning when POST operations to the API's /login route do not contain a session object (because how could they?).
  20. The admin.py module accepts the '--response_times' param now, and dumps HTML render times.

API Development

  1. Updated the Survivor object's set_name() method: HTML tags and entities are now stripped from incoming survivor names.
  2. Created a method in utils.py called html_stripper() that can blast the HTML tags and entities out of any string.

No comments:

Post a Comment