mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
Invent systemvpe() function
It goes 5x faster than system() and it's safer too.
This commit is contained in:
parent
1a5ef5ba13
commit
50394064d7
5 changed files with 132 additions and 4 deletions
|
@ -17,6 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/cosmo.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/mem/gc.h"
|
||||
#include "libc/mem/gc.internal.h"
|
||||
|
@ -243,6 +244,8 @@ int system2(const char *);
|
|||
BENCH(system, bench) {
|
||||
testlib_extract("/zip/echo.com", "echo.com", 0755);
|
||||
EZBENCH2("system cmd", donothing, system("./echo.com hi >/dev/null"));
|
||||
EZBENCH2("systemvpe cmd", donothing,
|
||||
systemvpe("./echo.com", (char *[]){"./echo.com", "hi", 0}, 0));
|
||||
EZBENCH2("cocmd echo", donothing, system("echo hi >/dev/null"));
|
||||
EZBENCH2("cocmd exit", donothing, system("exit"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue