Sunday, August 22, 2010

Re: In Windows system() exec is too slow.

On 18/08/10 16:11, bill lam wrote:
> Срд, 18 Авг 2010, 777 писал(а):
>> Hello All:
>> I want use system() in vim script, I find it too slow.
>> use it exec a very simple cmd, it will take about 1-2s
>> (goto to cmd.exe, exec some cmd, reback to vim).
>> Can make it fast?
>> Thanks.
>
> I think there should be overhead to start a new process in a shell. For
> comparison what will be the time taken to start from the command prompt and
> execute some programs using,
> > cmd /c "some simple cmd"
>
> Or if your vim is compiled with support +libcall, then calling dll/so
> should be faster.
>
>

Note that using lilbcall() to call a Windows system DLL will probably
crash, because libcall() uses C calling conventions (i.e. the caller
removes the arguments from the stack after the function returns) while
Windows system DLLs use Pascal calling conventions (i.e. the function
returns with a RET nnnn instruction, thus popping its arguments off the
stack).

libcall() and libcallnr() are meant ONLY to be used to call shared
libraries specially written to be used as binary plugins for Vim.


Best regards,
Tony.
--
Software, n.:
Formal evening attire for female computer analysts.

--
You received this message from the "vim_use" 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

No comments: