Fossil

Check-in [f52d63e3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added Jupyter nbviewer link for www/image-format-vs-repo-size.ipynb, and made a few small edits to the notebook after seeing it in that viewer.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f52d63e37bf8d2ec66fd36d5b62342193b2b42753e7535ef41e1681a040e361d
User & Date: wyoung 2019-03-27 19:59:23
Context
2019-03-30
00:46
Support both "1)" and "1." for numbered lists in markdown, as commonmark does. Patch from A. Kupries. check-in: 9d6a0aac user: drh tags: trunk
2019-03-27
19:59
Added Jupyter nbviewer link for www/image-format-vs-repo-size.ipynb, and made a few small edits to the notebook after seeing it in that viewer. check-in: f52d63e3 user: wyoung tags: trunk
18:45
Several improvements to the image-format-vs-repo-size experiment and the report documenting it: dropped the first 3 columns of data to make the bar chart clearer; drawing the bar chart on a transparent BG in case it's used on a page with a non-white BG, as with a selected Fossil forum post; added axis labels; added a run time calculation to the expensive first step; fixed a few syntax problems that prevent the Python code from compiling on Python 3; documented some problems with running it under Anaconda on macOS; better documented the notebook's dependencies; many clarifications to the experimental report text. check-in: 41e5237a user: wyoung tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to www/image-format-vs-repo-size.ipynb.

     6      6      "source": [
     7      7       "# Image Format vs Fossil Repository Size\n",
     8      8       "\n",
     9      9       "## Prerequisites\n",
    10     10       "\n",
    11     11       "This notebook was developed with [JupyterLab][jl]. To follow in my footsteps, install that and the needed Python packages:\n",
    12     12       "\n",
    13         -    "    $ sudo pip install jupyterlab matplotlib pandas wand\n",
           13  +    "    $ pip install jupyterlab matplotlib pandas wand\n",
    14     14       "\n",
    15     15       "In principle, it should also work with [Anaconda Navigator][an], but because [Wand][wp] is not currently in the Anaconda base package set, you may run into difficulties making it work, as we did on macOS. These problems might not occur on Windows or Linux.\n",
    16     16       "\n",
    17     17       "This notebook uses the Python 2 kernel because macOS does not include Python 3, and we don't want to make adding that a prerequisite for those re-running this experiement on their own macOS systems. The code was written with Python 3 syntax changes in mind, but we haven't yet successfully tried it in a Python 3 Jupyter kernel.\n",
    18     18       "\n",
    19     19       "[an]: https://www.anaconda.com/distribution/\n",
    20     20       "[jl]: https://github.com/jupyterlab/\n",
................................................................................
   148    148       "\n",
   149    149       "# Merge per-format test data into a single DataFrame without the first\n",
   150    150       "# first 3 rows: the initial empty repo state (boring) and the repo DB\n",
   151    151       "# size as it \"settles\" in its first few checkins.\n",
   152    152       "data = pd.concat(repo_sizes, axis=1).drop(range(3))\n",
   153    153       "\n",
   154    154       "mpl.rcParams['figure.figsize'] = (6, 4)\n",
   155         -    "#plt.rcParams['axes.facecolor'] = 'white'\n",
   156    155       "ax = data.plot(kind = 'bar', colormap = 'coolwarm',\n",
   157    156       "          grid = False, width = 0.8,\n",
   158    157       "          edgecolor = 'white', linewidth = 2)\n",
   159    158       "ax.axes.set_xlabel('Checkin index')\n",
   160    159       "ax.axes.set_ylabel('Repo size (MiB)')\n",
   161    160       "plt.savefig('image-format-vs-repo-size.svg', transparent=True)\n",
   162    161       "plt.show()"

Changes to www/image-format-vs-repo-size.md.

    75     75   [oox]: https://en.wikipedia.org/wiki/Office_Open_XML
    76     76   [wi]:  https://en.wikipedia.org/wiki/Windows_Installer
    77     77   
    78     78   
    79     79   
    80     80   ## Demonstration
    81     81   
    82         -The companion [`image-format-vs-repo-size.ipynb` file][nb] is a
    83         -[Jupyter][jp] notebook implementing the following experiment:
           82  +The companion `image-format-vs-repo-size.ipynb` file ([download][nbd],
           83  +[preview][nbp]) is a [Jupyter][jp] notebook implementing the following
           84  +experiment:
    84     85   
    85     86   1.  Create an empty Fossil repository; save its initial size.
    86     87   
    87     88   2.  Use [ImageMagick][im] via [Wand][wp] to generate a JPEG file of a
    88     89       particular size — currently 256 px² — filled with Gaussian noise to
    89     90       make data compression more difficult than with a solid-color image.
    90     91   
................................................................................
   105    106   modify the notebook to try different things.  Want to see how the
   106    107   results change with a different image size?  Easy, change the `size`
   107    108   value in the second cell of the notebook.  Want to try more image
   108    109   formats?  You can put anything ImageMagick can recognize into the
   109    110   `formats` list. Want to find the break-even point for images like those
   110    111   in your own respository?  Easily done with a small amount of code.
   111    112   
   112         -[im]: https://www.imagemagick.org/
   113         -[jp]: https://jupyter.org/
   114         -[nb]: ./image-format-vs-repo-size.ipynb
   115         -[wp]: http://wand-py.org/
          113  +[im]:  https://www.imagemagick.org/
          114  +[jp]:  https://jupyter.org/
          115  +[nbd]: ./image-format-vs-repo-size.ipynb
          116  +[nbp]: https://nbviewer.jupyter.org/urls/fossil-scm.org/fossil/doc/trunk/www/image-format-vs-repo-size.ipynb
          117  +[wp]:  http://wand-py.org/
   116    118   
   117    119   
   118    120   ## Results
   119    121   
   120    122   Running the notebook gives a bar chart something like⁴ this:
   121    123   
   122    124   ![results bar chart](./image-format-vs-repo-size.svg)