aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-12-22factor: detect squaresDenys Vlasenko
If we have a square, the speedup can be extremely large (in best case example below, it's ~40000 times faster): $ time ./busybox_old factor 18446743988964486098 18446743988964486098: 2 3037000493 3037000493 real 0m4.246s $ time ./busybox factor 18446743988964486098 18446743988964486098: 2 3037000493 3037000493 real 0m0.000s function old new delta isqrt_odd - 57 +57 print_w - 36 +36 factorize 218 236 +18 print_h - 7 +7 factorize_numstr 65 72 +7 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 2/0 up/down: 125/0) Total: 125 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-21lineedit: code shrinkDenys Vlasenko
function old new delta read_line_input 3171 3157 -14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-21lineedit: add a comment about possible use of tcflush()Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-21bc: do not allocate line editing state until neededDenys Vlasenko
function old new delta xc_read_line 324 353 +29 free_line_input_t 34 39 +5 xc_vm_init 656 640 -16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 34/-16) Total: 18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-21modprobe: Add support for modprobe.blacklist=module1,module2,...Andy Shevchenko
function old new delta parse_and_add_kcmdline_module_options - 186 +186 modprobe_main 713 798 +85 do_modprobe 648 451 -197 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/1 up/down: 271/-197) Total: 74 bytes Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-21hush: deal with FIXMEs for corner cases in parameter expansionDenys Vlasenko
function old new delta expand_one_var 2323 2344 +21 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-21factor: fix typo in undefDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-21factor: code shrinkDenys Vlasenko
function old new delta factor_main 176 171 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-20factor: 30% faster trial division (better sieve)Denys Vlasenko
function old new delta packed_wheel - 192 +192 factor_main 108 176 +68 factorize 284 218 -66 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/1 up/down: 260/-66) Total: 194 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-20hush: remove one redundant getpid() on every startupDenys Vlasenko
function old new delta hush_main 1151 1147 -4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-20ping6: add -w/-W NUM to --helpDenys Vlasenko
function old new delta packed_usage 33515 33533 +18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-20ping: fix -wN to not think that one packet is always lostDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-19ash: clear ungetc counter on syntax errorsDenys Vlasenko
function old new delta raise_exception 26 39 +13 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-19tftp: fix --helpDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-19route: code shrinkDenys Vlasenko
function old new delta kw_lookup 84 86 +2 tbl_hash_net_host 15 14 -1 tbl_verb 21 19 -2 tbl_ipvx 104 92 -12 packed_usage 33527 33493 -34 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/4 up/down: 2/-49) Total: -47 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-18help text tweaks, mainly expanding one for routeDenys Vlasenko
function old new delta packed_usage 33485 33527 +42 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-18help text: use -P PORT formDenys Vlasenko
function old new delta packed_usage 33502 33491 -11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-18help text tweaksDenys Vlasenko
function old new delta packed_usage 33570 33502 -68 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-17mount: if we race with other loop mount, we forget to close loop devDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-17move ADJTIME_PATH define to header filesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-17traceroute: fix --help textDenys Vlasenko
function old new delta traceroute_init 1151 1153 +2 packed_usage 33568 33570 +2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 4/0) Total: 4 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-17traceroute: avoid collecting target local address if !VERBOSEDenys Vlasenko
function old new delta common_traceroute_main 1542 1537 -5 traceroute_init 1151 1101 -50 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-55) Total: -55 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-17mount: fix a race when a free loop device is snatched under us by another mount.Denys Vlasenko
function old new delta set_loop 850 809 -41 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-17mail: launch_helper(): flush stdio before vfork, set G.helper_pid only in parentDenys Vlasenko
function old new delta launch_helper 188 193 +5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-17mail: deobfuscate launch_helper()Denys Vlasenko
13 bytes are not worth the risk of doing something iffy after vfork(). Let's have much clearer code there. function old new delta launch_helper 175 188 +13 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-17mail: commonalize send_r_n()Denys Vlasenko
function old new delta send_mail_command 85 55 -30 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-17mail: move "opts" from globalsDenys Vlasenko
function old new delta popmaildir_main 812 823 +11 sendmail_main 1295 1301 +6 makemime_main 291 288 -3 parse 970 966 -4 reformime_main 107 100 -7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/3 up/down: 17/-14) Total: 3 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-17shells: a fix for systems without RLIMIT_NICEDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-17Fixes for Hurd buildDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-16libbb: do not compile selinux_or_die() if !SELINUXDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-16build system: make -static-libgcc selectable in configDenys Vlasenko
OpenWrt wants this off. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-16libbb: introduce and use xsettimeofday()Denys Vlasenko
function old new delta xsettimeofday - 25 +25 rdate_main 274 260 -14 step_time 348 331 -17 set_kernel_timezone_and_clock 119 102 -17 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/3 up/down: 25/-48) Total: -23 bytes text data bss dec hex filename 1020753 559 5052 1026364 fa93c busybox_old 1020708 559 5052 1026319 fa90f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-16hwclock: improve --help (-l is a compatible shortcut for --localtime)Denys Vlasenko
function old new delta packed_usage 33605 33568 -37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-16hwclock: fix musl breakage of settimeofday(tz)Denys Vlasenko
function old new delta set_kernel_timezone_and_clock - 119 +119 set_kernel_tz - 28 +28 hwclock_main 480 301 -179 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/1 up/down: 147/-179) Total: -32 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-16lineedit: disable completion and fancy prompts if no shells are selectedDenys Vlasenko
function old new delta get_previous_history 51 56 +5 get_next_history 47 52 +5 null_str 1 - -1 beep 10 - -10 bb_msg_unknown 10 - -10 bb_internal_setpwent 24 - -24 remove_chunk 30 - -30 goto_new_line 33 - -33 bb_internal_endpwent 36 - -36 deinit_S 51 - -51 free_tab_completion_data 54 - -54 read_line_input 3171 3114 -57 rewind 68 - -68 add_match 70 - -70 complete_username 77 - -77 quote_special_chars 78 - -78 build_match_prefix 557 - -557 complete_cmd_dir_file 697 - -697 parse_and_put_prompt 823 53 -770 input_tab 926 - -926 ------------------------------------------------------------------------------ (add/remove: 0/17 grow/shrink: 2/2 up/down: 10/-3549) Total: -3539 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-16lineedit: use strncmp instead of is_prefixed_with (we know the length)Denys Vlasenko
Also: add comments, rename some variables Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-16lineedit: remove ->path_lookup if ash is not configuredDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-16lineedit: match local directories when searching PATHRon Yorston
When tab-completing a command we search PATH if the partial text doesn't include a slash. Also match subdirectories of the current directory, in case the user intends to run a binary from one of them. function old new delta complete_cmd_dir_file 894 917 +23 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 23/0) Total: 23 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-16lineedit: omit directories when tab-completing from PATHRon Yorston
Only files should be matched when using PATH for tab-completion. function old new delta complete_cmd_dir_file 883 894 +11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 11/0) Total: 11 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-16tweak help textsDenys Vlasenko
function old new delta packed_usage 33650 33605 -45 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-15ntpd: allow non-root to run it (e.g. with -w option)Denys Vlasenko
This is safe: it's not a setuid applet, the attempt to set time will simply fail if attempted by non-root From openwrt 600-allow-ntpd-non-root.patch function old new delta ntp_init 1049 1005 -44 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-15libbb: make pw_encrypt() die if supplied salt is bad (e.g. emply)Denys Vlasenko
Fished from 520-loginutils-handle-crypt-failures.patch in openwrt function old new delta pw_encrypt 913 927 +14 des_crypt 1327 1318 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 14/-9) Total: 5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-15udhcpc6: code shrink - sending functions do not need ifindex parameterDenys Vlasenko
function old new delta d6_send_raw_packet_from_client_data_ifindex - 427 +427 d6_send_kernel_packet_from_client_data_ifindex - 275 +275 send_d6_renew 182 176 -6 perform_d6_release 246 240 -6 d6_mcast_from_client_data_ifindex 45 39 -6 d6_send_kernel_packet 274 - -274 d6_send_raw_packet 429 - -429 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 0/3 up/down: 702/-721) Total: -19 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-15udhcp: bind to device even for ucast packetsMichal Kazior
There are cases where binding to source IP and destination IP is insufficient to guarantee sane xmit netdev. One case where this can fail is when route-matching netdev carrier is down (cable unplugged, wifi disconnected), or the netdev is admin down. Then all the IP based bindings (bind() + connect()) will seemingly succeed but the actual packet can go out through a default gw path. Depending on the network this happens on it can create issues or false alarms. It can also leak some subnet info across networks that shouldn't be routed. As such better be safe than sorry and bind to a netdev to be sure it's used for xmit. function old new delta udhcp_send_kernel_packet 293 336 +43 send_packet 182 188 +6 bcast_or_ucast 37 43 +6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 55/0) Total: 55 bytes Signed-off-by: Michal Kazior <michal@plume.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-15libbb: enable fixed 4k pagesize for 32bit ARMDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-15tls: code shrink in AES codeDenys Vlasenko
function old new delta aes_cbc_decrypt 862 847 -15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-15build system: combat gcc zealotry in data alignment, now for x86_64 tooDenys Vlasenko
function old new delta .rodata 182928 182620 -308 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-14dd: support for O_DIRECT i/oDenys Vlasenko
Based on patch by Akash Hadke <hadkeakash4@gmail.com> function old new delta dd_read - 66 +66 clear_O_DIRECT - 55 +55 write_and_stats 102 135 +33 dd_main 1578 1601 +23 static.oflag_words 19 26 +7 static.iflag_words 22 29 +7 packed_usage 33665 33668 +3 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 5/0 up/down: 194/0) Total: 194 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-14libbb: add and use infrastructure for fixed page size optimizationDenys Vlasenko
function old new delta procps_scan 1121 1118 -3 getpagesize 6 - -6 rpm_main 1037 1027 -10 rpm2cpio_main 120 110 -10 ptok 38 21 -17 time_main 1282 1261 -21 mkswap_main 317 278 -39 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/6 up/down: 0/-106) Total: -106 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-14libbb: create and use mmap() helpersDenys Vlasenko
function old new delta mmap_anon - 22 +22 mmap_read - 21 +21 xmmap_anon - 16 +16 rpm_gettags 465 447 -18 bb_full_fd_action 498 480 -18 uevent_main 337 310 -27 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 0/3 up/down: 59/-63) Total: -4 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>