Message Boards Message Boards

Use Iconize[] in ".m" package files?

Posted 5 years ago

I've got a package that takes 10-15 seconds to initialize when I include it:

<<my_package`;

Most of that time is spent compiling a collection of few complicated functions. When I learned about Iconize[], I thought it would be a great way to reduce this load time: just compile the functions once, and store the "binaries" in the package file in an iconized format.

The good news: It worked-- my load times went down to less than a second!

The bad news: when I reopen the package file, the iconized content has been expanded, making the ".m" file totally unreadable!

For example, after saving this as a ".m" file enter image description here

when I reopen it, the Iconized data in the assignment (but not the result of the first statement?) is expanded to a big mess: enter image description here

Notebook files (".nb") do not have this issue: iconized data stays iconized when closing/reopening files. Is this a bug, or can anyone help me figure out a workaround?

POSTED BY: Sam M
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract