[Vm-dev] Extending primitiveDirectoryEntry

K K Subbu kksubbu.ml at gmail.com
Mon Apr 24 10:33:42 UTC 2017


On Sunday 23 April 2017 10:26 PM, Alistair Grant wrote:
> While I was profiling this I noticed that
> DiskStore>>defaultWorkingDirectory is the most called method by a factor
> of about 3, as it is called every time a filename is resolved.
>
> #defaultWorkingDirectory is relatively expensive as it calls a primitive
> to get the image directory, converts the resulting ByteString to a byte
> array, calls ZnCharacterEncoder to decode it, converts the string to a
> path, and finally gets the parent.

Directory paths like these are really part of the host environment. Is 
there any need to reify them within an image? As long as we use only 
relative paths, then paths like VM, Plugin, Image, current directory 
etc. can be encoded using special prefixes (say "$vm" or "~vm" or "vm:") 
in persistent image variables and expanded into full paths by VM 
(through plugins) at run time using environment variables or command 
line options. The plugin can cache these nodes to improve performance.

Regards .. Subbu


More information about the Vm-dev mailing list