How to find and list the size of individual tiddlers

I’d like to know if there is a way to identify the size (in kb) of each tiddler and then to list them in size order.
I have a single html file TiddlyWiki instance which I use with TiddlyDesktop. It is now 15MB in size with 800 individual tiddlers. All images are external.
I tried the tiddler manager, which is where I’d expect such a feature to reside - but it’s not there. I think if I used nodejs each tiddler would be a separate file with an obvious size, but I’d rather use a single file at this point.
If I could list all the tiddlers in size order I’d be able to slim down the file to below 15MB just by editing or deleting the most bloated tiddlers.
The Performance info says ‘avoid large tiddlers’, but I’m currently not sure which these are. How would you know, I wonder?

I’m using:
OS: Windows 10
Browser: TiddlyDesktop 0.0.14
Tiddlywiki version 5.2.0

1 Like

That sounds big!
I have more tiddlers with a smaller size.
It could be plugins?

This will give you a nice table of titles and sizes (in bytes)

<table><tr><th>title</th><th>size</th></tr>
<$list filter="[all[tiddlers]] :sort:integer:reverse[<currentTiddler>get[text]length[]]">
   <tr>
      <td><$link/></td>
      <td style="text-align:right;"><$text text={{{ [<currentTiddler>get[text]length[]] }}}/></td>
   </tr>
</$list>
</table>

If you want the size reported in kb, add divide[1024]fixed[2], like this:

<$text text={{{ [<currentTiddler>get[text]length[]divide[1024]fixed[2]] }}}/>

enjoy,
-e

7 Likes

Thanks very much @EricShulman - the table is exactly what was needed. It quickly revealed that when converting internal images to external links (using the _canonical_uri field), I had failed to purge the original images!
And thanks @Ste_W - as you suggested, it was clear I had a large plugin that wasn’t needed. Deleting these items has reduced the total file size by more than half. Great result.

There is also this for Plugin sizes;

Plugin-Size.json (6.3 KB)

I suggest you look for the source.

1 Like

Source and dependencies:
https://tid.li/tw5/plugins.html

Cheers, Thomas

1 Like