Today see the group of children's shoes are discussing the use of ln command, the hype about the symlink, there are students with an estimate of the tone said symlink time is very low, it is certain that ln total time is symlink good hundreds of times times, he guessed it?
Now verify the STRACE-TT-T output for ln-s ~/install install:
14:08:20.190334 execve ("/bin/ln", ["ln", "-S", "/home/linxp/install", "Install"], ["xdg_vtnr=7", "ssh_agent_pid=2251" , "Xdg_session_id=c2", "Clutter_im_module=xim", "Session=ubuntu", "Term=xterm", "xdg_menu_prefix=gnome-", "SHELL=/ Bin/bash "," vte_version=3406 "," windowid=65011719 "," upstart_session=unix:abstract=/c "...," gnome_keyring_control= /run/user/"...," Gtk_modules=overlay-scrollbar:un "...," User=linxp "," ls_colors=rs=0:di=01;34:ln=01;36 "...," XDG_ Session_path=/org/freedeskto "...," xdg_seat_path=/org/freedesktop/d "...," Ssh_auth_sock=/run/user/1000/key "...," Session_manager=local/ubuntu:@/t "...," defaults_path=/usr/share/gconf/u "...," Xdg_config_dirs=/etc/xdg/xdg-ubu " ..., "path=/usr/lib/lightdm/lightdm:/u" ..., "Desktop_session=ubuntu", "Job=dbus", "pwd=/tmp", "[email Protected]=fcitx "," gnome_keyring_pid=2190 "," Lang=en_us. " UTF-8 "," Gdm_lang=en_us "," mandatory_path=/usr/share/gconf/"...," Ubuntu_menuproxy=1 "," im_config_phase=1 "," COMPIZ _config_profile=ubuntu "," Gdmsession=ubUntu "," Sessiontype=gnome-session "," shlvl=1 "," Xdg_seat=seat0 "," Home=/home/linxp "," Language=en_us "," GNOME_ Desktop_session_id=this-is "...," upstart_instance= "," upstart_events=started xsession "," Logname=linxp "," COMPIZ_ Bin_path=/usr/bin/"," Qt4_im_module=fcitx "," Xdg_data_dirs=/usr/share/ubuntu: "...," Dbus_session_bus_address=unix : AB "...," lessopen=| /usr/bin/lesspipe%s "," instance= "," Upstart_job=gnome-session "," Textdomain=im-config "," Xdg_runtime_dir=/run/user /1000 "," display=:0 "," xdg_current_desktop=unity "," Gtk_im_module=fcitx "," Lessclose=/usr/bin/lesspipe%s% "...," textdomaindir=/usr/share/locale/"," colorterm=gnome-terminal "," xauthority=/home/linxp/. " Xauthori "...," _=/usr/bin/strace "," oldpwd=/home/linxp/test "]) = 0 <0.000402>
14:08:20.192273 BRK (0) = 0x954a000 <0.000022>
... ...
14:08:20.239693 symlink ("/home/linxp/install", "install/install") =-1 eexist (File exists) <0.000032>
... ...
14:08:20.243516 Close (2) = 0 <0.000021>
14:08:20.243626 Exit_group (1) =?
14:08:20.243825 + + + exited with 1 + + + +
Total microsecond time T = 243825-190334 = 0.053491
Symlink time t = 0.000032
Visible symlink time-consuming low, the main operation time is where: (-tt-v-C)
% time seconds Usecs/call calls errors Syscall
------ ----------- ----------- --------- --------- ----------------
0.00 0.000000 0 3 Read
0.00 0.000000 0 4 Write
0.00 0.000000 0 8 Open
0.00 0.000000 0 8 Close
0.00 0.000000 0 1 Execve
0.00 0.000000 0 3 3 Access
0.00 0.000000 0 3 BRK
0.00 0.000000 0 1 1 symlink
0.00 0.000000 0 2 Munmap
0.00 0.000000 0 3 Mprotect
0.00 0.000000 0 1 1 _llseek
0.00 0.000000 0 MMAP2
0.00 0.000000 0 1 Stat64
0.00 0.000000 0 5 Fstat64
0.00 0.000000 0 1 Set_thread_area
------ ----------- ----------- --------- --------- ----------------
The main is still in the interrupt, IO operation more time-consuming home!
How much time is spent in symlink in the process of ln