WarshipGirls/WGViewer

Profile final application size with new libraries for plotting

Closed this issue · 4 comments

pwyq commented

Choose a plotting library based on its

  • functionality
  • resulting final app size

#113

pwyq commented

Tested with a simple PyQt hello world script. Each time the requirements.txt file is minimized to entailed packages.

with following imports, has size of 35,535,196 bytes

import sys
from PyQt5.QtWidgets import *

with following imports, has size of 35,535,204 bytes

import sys
from PyQt5.QtWidgets import QWidget, QLabel, QApplication

with following imports, has size of 35,535,360 bytes

import sys
from PyQt5.QtWidgets import QWidget, QLabel, QApplication
import plotly.graph_objects as go

with following imports, has size of 86,594,717 bytes

import sys
from PyQt5.QtWidgets import QWidget, QLabel, QApplication
import plotly.graph_objects as go
import pandas as pd

Conclusion: adding plotly is fine, but pandas (comes along with numpy) is absolutely no.

pwyq commented

#136 the latest build has an staggering size over 160 MB...

pwyq commented

All right, I shall blame the PyQtWebEngine!

(wgv_venv) D:\github\test\dist>dir
 Volume in drive D is DATA
 Volume Serial Number is 3C68-D19D

 Directory of D:\github\test\dist

2020-12-19  10:37 AM    <DIR>          .
2020-12-19  10:37 AM    <DIR>          ..
2020-12-19  10:37 AM       140,765,744 hi.exe
               1 File(s)    140,765,744 bytes
               2 Dir(s)  624,605,220,864 bytes free

(wgv_venv) D:\github\test\dist>cd ..

(wgv_venv) D:\github\test>cat requirements.txt
plotly==4.14.1
PyQt5==5.15.2
PyQt5-sip==12.8.1
PyQtWebEngine==5.15.2
retrying==1.3.3
six==1.15.0
pwyq commented

Trade off between:
Using QWebEnging

  • ++: neat one standalone
  • --: 160MB

Using user browser

  • ++: smaller in size 90MB
  • --: need to access user browser