Hi Using the heap memory profiler 'valgrind --tool=massif vim' I saw 146,176 bytes allocated from here:
| | ->02.03% (146,176B) 0x492B61: do_autocmd_event (fileio.c:8623) | | | ->02.03% (146,176B) 0x4925F0: do_autocmd (fileio.c:8401) | | | ->02.03% (146,176B) 0x46CFDD: ex_autocmd (ex_docmd.c:5052) | | | ->02.03% (146,176B) 0x46869B: do_one_cmd (ex_docmd.c:2689) | | | ->02.03% (146,176B) 0x465C00: do_cmdline (ex_docmd.c:1127) | | | ->02.01% (145,280B) 0x4638E9: do_source (ex_cmds2.c:3290) | | | | ->02.01% (144,704B) 0x462B65: source_callback (ex_cmds2.c:2717) | | | | | ->02.01% (144,704B) 0x462D66: do_in_runtimepath (ex_cmds2.c:2811) | | | | | ->02.01% (144,704B) 0x462B8F: source_runtime (ex_cmds2.c:2731) | | | | | ->01.82% (131,008B) 0x4769EC: ex_filetype (ex_docmd.c:11290) ...snip... It comes from allocating several 'AutoPat' structures in fileio.c: 8623 ap = (AutoPat *)alloc((unsigned)sizeof(AutoPat)); Putting some debug printf(), I can see that sizeof(AutoPat)=64 bytes (on Linux x86_64). Attached patch reorders fields in AutoPat to reduce waste caused by padding & alignment and brings sizeof(AutoPat) to 48 bytes. In this case, it should thus save: 146,176 - 146,176/64*48 = 36,544 bytes. I'll search for other such optimizations when I have time. Regards Dominique -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
save-mem-fileio.c-7.3.1163.patch
Description: Binary data
