-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reserved exit codes #13
Comments
Just seeing this, sorry for the huge delay. So you recommend just switching to exit codes |
Also just curious... How long does your implementation is Rust take to run Here is my result: using python -m json.tool ➜ time ./set_get_delete_500.bash
./set_get_delete_500.bash 15.86s user 15.64s system 95% cpu 32.871 total using jq (3.1x performance improvement)
using yajl (3.9x performance improvement)
|
For the exit codes, there has been a attempt to standardize them in #define EX_USAGE 64 /* command line usage error */
#define EX_DATAERR 65 /* data format error */
#define EX_NOINPUT 66 /* cannot open input */
#define EX_NOUSER 67 /* addressee unknown */
#define EX_NOHOST 68 /* host name unknown */
#define EX_UNAVAILABLE 69 /* service unavailable */
#define EX_SOFTWARE 70 /* internal software error */
#define EX_OSERR 71 /* system error (e.g., can't fork) */
#define EX_OSFILE 72 /* critical OS file missing */
#define EX_CANTCREAT 73 /* can't create (user) output file */
#define EX_IOERR 74 /* input/output error */
#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */
#define EX_PROTOCOL 76 /* remote error in protocol */
#define EX_NOPERM 77 /* permission denied */
#define EX_CONFIG 78 /* configuration error */ So I think it's a good practice to use them! As for execution time, I get something close to yours using
I pushed the test file if you want to try it (it's basically the same as yours, though you'll have to manually drop the jsonlite directory first). Now on my computer with Python I get this:
And yajl...
I guess I'm even worst at Rust than I thought I was! Now I don't know if it's the JSON encoding / decoding part that's slow or the reads and writes... I thought it'd be mostly I/O bound but seeing your results I guess the JSON encoding / decoding is in fact quite intensive! |
I just started a Rust implementation and I was looking for exit codes to return on error, and I saw that you are using codes from 1 to 4. Wouldn't it be better to normalize those codes, avoiding 1 and 2 as 1 is for general errors and 2 is for builtins incorrect usage (see https://www.gnu.org/software/bash/manual/bash.html#Exit-Status and http://tldp.org/LDP/abs/html/exitcodes.html).
The text was updated successfully, but these errors were encountered: