On 2011-04-06, at 8:17 PM, chevalma@iro.umontreal.ca wrote:
Here are the running times in seconds (after a few dry runs):
direct embedded code 0.003 copied embedded code 0.016 file code 0.009
The run time advantage of the first method is pretty clear. The startup is 3 to 5 times faster than the other methods.
So lets aim to implement that. As I said, the startup time is really important for some applications
I thought we'd already agreed. The second approach is more compatible with our system, for reasons I've mentioned in the meeting.
Please explain what you mean by "more compatible with our system". It is not clear to me what you mean. Also, I don't recall that we agreed on anything concerning the design of the loader. I originally agreed with your argument that it wouldn't be possible to patch the executable code, but I later explained that this would not be a problem because we can use the OS assembler to patch the addresses when the file is loaded.
I have to question how < 20ms could be too long of a load time for our applications (that's less than 1/50th of a second)...
One applications where startup time is important is when you have a web server processing requests by starting up a new process running the desired program (which is a realistic situation for our "server-side" use of Tachyon). If it takes 1/50th of a second to start the program, then you can only process 50 requests per second (per processor). That's lame. Being 5 times faster matters. Shell scripts which invoke lots of small programs (for example when the operating system is booting up) is another situation.
And I have to question how reading a whole other binary file and reading its contents could be faster than doing a memcpy of something that's already in memory.
I'm not sure what it is you "question" in my results. These are measurements on a real machine! It seems reasonable to me... In the memcpy case there are two copies being done (one from disk to memory when loading the program, and one from memory to memory when doing the memcpy). When reading from a file, there is only one copy (from disk to memory). Also in the "direct embedded code" approach, not all the code is run, so the operating system may just map it in the virtual address space and not even load it into RAM. That's one more advantage of using the OS loader where possible.
Marc