ranjanistic/knotters

Optimizations

ranjanistic opened this issue · 3 comments

Optimizations for efficient use of resources and scaling up performance, by doing things like following (but not limited to) -

  • Save RAM space by reducing extraneous variables, using incremental memory allocation (example - not loading everything in memory at once, like in arrays), reducing global variables, returning function results without variables, replacing import module statements with from module import object as something , etc.

  • Reduce extra and unnecessary HTML code wherever possible, most importantly in the html of dynamic content like browsable strips and vertical snapshots, etc. to scale up client side performance, etc.

  • Make all POST request paths contain dynamic parameters in them to efficiently manage sitemaps and efficient segregation of POST paths and other method paths.

  • Decrease client side javascript tasks on main thread, i.e., reduce large monolithic script files and replace them with smaller script files (chunks) for faster client side code execution, use async script load or web workers wherever possible, or any better approach, etc.

  • Use .webp encoding for images/gifs instead of .png or .jpg, resize large static images to the size at which they are being displayed, individual graphics and static images to not exceed 100 KB, etc.

  • Reducing individual large stylesheets by replacing them with multiple smaller stylesheets if applicable, or any better approach, etc.

  • Optimize database queries by executing them only once at the end of a process wherever applicable, reduce multiple frequent database hits, improve query performance, store results in cache, etc.

  • Using server side caching wherever large results or queries are computed or executed, and related cache removal to prevent outdated information primarily in database models (see CACHE_KEYS and clearCache methods of Profile class of people module models as reference)

  • Make emailing functions to be able to be called directly instead of passing them as string to cluster manually. To achieve this, the main emailing functions can be wrapped in cluster call.

  • And anything worth optimizing.

  • Get rid of alertify js and css

Increase the response time of endpoint functions by passing their long running tasks to qcluster.