skeeto / caliper

Compute Emacs Lisp object sizes.
The Unlicense
10 stars 2 forks source link

Strange results.. #1

Open vapniks opened 3 months ago

vapniks commented 3 months ago

I have a couple of org-tables one of which is much larger than the other. Before coming across you library I asked chatgpt to write a function for estimating elisp object sizes, and it came up with this: https://gist.github.com/vapniks/542a3c642e6fa459d7ed3e719d9aabf7 In the table below I've listed the table dimensions, and the results returned by the chatgpt generated function and caliper-object-size:

table 1 table 2 ratio (table1/table2)
num dlines 38 59 0.644
num hlines 0 20 0
num columns 2 27 0.074
width in chars 105 262 0.401
total displayed chars 3990 20698 0.193
estimate-list-size 2930 16988 0.172
caliper-object-size 9469875 9543694 0.9923

My question is; why are the results of caliper-object-size so wildly different to those of estimate-list-size, especially the final column?

vapniks commented 3 months ago

Btw, you might like this.. solving mazelog puzzles automatically using org-tables: https://github.com/vapniks/org-table-jb-extras/blob/main/org-table-solve-mazelog.org