lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Daurnimator once stated:
> On 6 January 2018 at 13:48, Sean Conner <sean@conman.org> wrote:
> >   I finally have some time, so I thought I might check the sizes of Lua
> > source code, compressed Lua source code [1], compiled Lua code and
> > compressed compiled Lua code, for both 32 bit and 64 bit systems (and yes,
> > there is a difference in compiled Lua sizes).
> 
> Please compare stripped vs unstripped bytecode.

  Very interesting results (attached).  Sometimes, the text is smaller than
the stripped compiled version, sometimes not.  Sometimes the compressed text
is smaller than the stripped compiled version, sometimes not.  You would
really have to measure when embedding Lua into your executable.

  -spc

text	ztext	bin	zbin	sbin	zsbin	filename
-----------------------------------------------------------------
 4167	 1479	 6107	 2647	 3465	 1980	add.lua
 3267	 1207	 4830	 2137	 2757	 1566	admin_remove.lua
15750	 4229	17277	 6352	 9432	 4545	build.lua
11312	 2888	15600	 5552	 8003	 3895	builtin.lua
 2178	  886	 2637	 1196	 1578	  909	cmake.lua
  932	  389	 1023	  487	  602	  349	command.lua
 3417	 1141	 3357	 1337	 1676	  894	make.lua
 2858	  894	 3738	 1571	 2061	 1140	cache.lua
24477	 6885	25939	 9963	15074	 7451	cfg.lua
 7108	 2440	 9249	 3903	 5327	 2893	command_line.lua
 1973	  745	 2677	 1212	 1735	  930	config_cmd.lua
28517	 7227	25819	 9141	13073	 6019	deps.lua
 2570	  957	 2208	  857	 1382	  637	dir.lua
 5059	 1586	 7219	 3013	 3675	 2103	doc.lua
 3409	 1202	 4281	 1884	 2227	 1281	download.lua
15275	 3871	15081	 5314	 8407	 3787	fetch.lua
 1832	  755	 2171	 1007	 1193	  723	cvs.lua
 3570	 1392	 3880	 1680	 2095	 1215	git.lua
  792	  403	  588	  324	  318	  215	git_file.lua
 1143	  571	  597	  326	  323	  214	git_http.lua
  357	  219	  198	  134	  114	   84	git_https.lua
 1382	  650	  763	  391	  431	  271	git_ssh.lua
 2098	  833	 2474	 1105	 1337	  786	hg.lua
 1004	  510	  575	  317	  309	  208	hg_http.lua
  346	  216	  196	  134	  113	   83	hg_https.lua
  340	  215	  194	  136	  113	   83	hg_ssh.lua
 1840	  830	 1999	  982	 1138	  718	sscm.lua
 2140	  847	 2725	 1239	 1457	  876	svn.lua
 2139	  869	 3272	 1404	 1600	  904	fs.lua
28208	 7156	30616	10290	16499	 6850	lua.lua
 5310	 1869	 6169	 2422	 3597	 1771	tools.lua
 4697	 1661	 4924	 2048	 2989	 1534	unix.lua
 7808	 2258	 9341	 3175	 5566	 2275	tools.lua
 9289	 3063	 9954	 3641	 5877	 2612	win32.lua
 7615	 2160	 8347	 2751	 5011	 1981	tools.lua
 4593	 1660	 5825	 2437	 3822	 1943	help.lua
 5492	 1976	 7468	 3260	 4393	 2443	index.lua
 7272	 1967	 8235	 2939	 5012	 2248	install.lua
 1527	  694	 1737	  884	 1120	  677	lint.lua
 3323	 1078	 4498	 1882	 2254	 1258	list.lua
 9690	 2992	 7972	 3024	 3552	 1881	loader.lua
 3831	 1436	 4392	 1944	 3164	 1618	make.lua
 1871	  754	 2383	 1117	 1466	  850	make_manifest.lua
24069	 5285	25293	 7852	11724	 4729	manif.lua
 4153	 1283	 3603	 1375	 1808	  871	manif_core.lua
 6292	 1964	 7052	 2960	 4182	 2183	new_version.lua
 7043	 2101	 8466	 3271	 4527	 2314	pack.lua
14996	 3091	15816	 3837	 8981	 2591	path.lua
 2268	  762	 2677	 1101	 1866	  900	path_cmd.lua
 6883	 2014	 6275	 2559	 3034	 1622	persist.lua
 2614	  966	 3821	 1700	 2295	 1263	purge.lua
 1061	  452	 1388	  716	  884	  548	refresh_cache.lua
 6594	 2026	 8136	 3195	 4320	 2254	remove.lua
17202	 4044	19286	 5928	 8821	 3623	repos.lua
  108	   92	  182	  123	  106	   76	require.lua
18429	 4609	18559	 6303	 8942	 4049	search.lua
 5636	 1726	 7906	 3090	 4277	 2200	show.lua
  492	  213	  630	  349	  494	  281	site_config.lua
22010	 5650	23476	 8374	11102	 5197	patch.lua
 4804	 1420	 6588	 2485	 3582	 1735	tar.lua
 8683	 2114	 9252	 3017	 5016	 1942	zip.lua
11511	 2891	 8778	 3470	 4766	 2373	type_check.lua
 6135	 1758	 6459	 2487	 3719	 1834	unpack.lua
 3014	 1057	 3944	 1828	 2577	 1487	upload.lua
 8674	 2577	12772	 5115	 7174	 3663	api.lua
 2800	 1052	 4562	 1963	 2338	 1293	multipart.lua
23374	 7126	22830	 8546	12428	 5675	util.lua
 4622	 1310	 7288	 2707	 3704	 1804	validate.lua
12284	 3664	16503	 6592	 9543	 4812	write_rockspec.lua
text	ztext	bin	zbin	sbin	zsbin	filename
-----------------------------------------------------------------
 4167	 1479	 6723	 2669	 3849	 2001	add.lua
 3267	 1207	 5322	 2163	 3041	 1584	admin_remove.lua
15750	 4229	18889	 6442	10304	 4608	build.lua
11312	 2888	17416	 5638	 9087	 3963	builtin.lua
 2178	  886	 2917	 1211	 1782	  923	cmake.lua
  932	  389	 1123	  495	  674	  355	command.lua
 3417	 1141	 3689	 1355	 1860	  907	make.lua
 2858	  894	 4150	 1592	 2313	 1157	cache.lua
24477	 6885	28519	10102	16954	 7566	cfg.lua
 7108	 2440	10153	 3953	 5891	 2935	command_line.lua
 1973	  745	 2941	 1235	 1923	  945	config_cmd.lua
28517	 7227	28451	 9265	14505	 6094	deps.lua
 2570	  957	 2488	  875	 1610	  656	dir.lua
 5059	 1586	 7951	 3051	 4039	 2131	doc.lua
 3409	 1202	 4749	 1909	 2463	 1302	download.lua
15275	 3871	16581	 5385	 9347	 3847	fetch.lua
 1832	  755	 2403	 1021	 1341	  733	cvs.lua
 3570	 1392	 4256	 1705	 2331	 1233	git.lua
  792	  403	  656	  330	  362	  220	git_file.lua
 1143	  571	  669	  334	  371	  219	git_http.lua
  357	  219	  210	  133	  126	   84	git_https.lua
 1382	  650	  847	  396	  491	  277	git_ssh.lua
 2098	  833	 2730	 1120	 1501	  799	hg.lua
 1004	  510	  643	  323	  353	  207	hg_http.lua
  346	  216	  208	  133	  125	   83	hg_https.lua
  340	  215	  206	  135	  125	   83	hg_ssh.lua
 1840	  830	 2223	  997	 1290	  729	sscm.lua
 2140	  847	 3013	 1253	 1637	  891	svn.lua
 2139	  869	 3640	 1426	 1784	  922	fs.lua
28208	 7156	33960	10461	18427	 6949	lua.lua
 5310	 1869	 6853	 2461	 4069	 1809	tools.lua
 4697	 1661	 5472	 2085	 3385	 1558	unix.lua
 7808	 2258	10465	 3220	 6334	 2320	tools.lua
 9289	 3063	11090	 3698	 6689	 2663	win32.lua
 7615	 2160	 9287	 2796	 5671	 2015	tools.lua
 4593	 1660	 6333	 2471	 4182	 1964	help.lua
 5492	 1976	 8172	 3300	 4781	 2463	index.lua
 7272	 1967	 8991	 2980	 5480	 2276	install.lua
 1527	  694	 1921	  896	 1248	  687	lint.lua
 3323	 1078	 5010	 1909	 2514	 1279	list.lua
 9690	 2992	 8896	 3073	 3924	 1905	loader.lua
 3831	 1436	 4712	 1966	 3360	 1634	make.lua
 1871	  754	 2627	 1130	 1618	  860	make_manifest.lua
24069	 5285	27989	 7961	12964	 4788	manif.lua
 4153	 1283	 3995	 1399	 1996	  892	manif_core.lua
 6292	 1964	 7620	 2995	 4486	 2203	new_version.lua
 7043	 2101	 9342	 3322	 5011	 2355	pack.lua
14996	 3091	17564	 3891	10125	 2625	path.lua
 2268	  762	 2853	 1111	 2002	  909	path_cmd.lua
 6883	 2014	 6975	 2595	 3402	 1647	persist.lua
 2614	  966	 4221	 1734	 2523	 1281	purge.lua
 1061	  452	 1528	  725	  976	  556	refresh_cache.lua
 6594	 2026	 9008	 3241	 4768	 2282	remove.lua
17202	 4044	21294	 6018	 9613	 3671	repos.lua
  108	   92	  194	  122	  118	   76	require.lua
18429	 4609	20519	 6396	 9898	 4109	search.lua
 5636	 1726	 8670	 3135	 4713	 2227	show.lua
  794	  299	 1093	  491	  877	  406	site_config.lua
22010	 5650	25584	 8469	11970	 5246	patch.lua
 4804	 1420	 7212	 2519	 3970	 1754	tar.lua
 8683	 2114	10100	 3062	 5524	 1966	zip.lua
11511	 2891	 9642	 3520	 5330	 2407	type_check.lua
 6135	 1758	 7079	 2521	 4099	 1859	unpack.lua
 3014	 1057	 4268	 1850	 2809	 1507	upload.lua
 8674	 2577	14168	 5198	 8042	 3717	api.lua
 2800	 1052	 5082	 1997	 2634	 1317	multipart.lua
23374	 7126	25382	 8678	13920	 5776	util.lua
 4622	 1310	 8064	 2750	 4112	 1832	validate.lua
12284	 3664	18127	 6686	10535	 4878	write_rockspec.lua