You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# when i run the command:pry(main)> show-sourceString#length`# it gives the C code for rb_str_length:
...
VALUErb_str_length(VALUEstr){longlen;len=str_strlen(str,STR_ENC_GET(str));returnLONG2NUM(len);}# but there seems to be no way to look at the code for the definitions of str_strlen, VALUE, STR_ENC_GET, LONG2NUM without something like grep, vim & ctags to research the ruby C sources# it would be very useful, when tracing ruby code to determine the source of performance issues, to be able to follow logic down to the lowest levels of the C code# it would be very fast & easy on the brain to be able to do this from within the pry window# perhaps another command show-c-source could be added:pry(main)> show-c-sourcestr_strlen# would give something like:staticlongstr_strlen(VALUEstr,rb_encoding *enc){constchar *p, *e;longn;intcr;
...
returnn;}# i am starting to look at ruby performance seriously, and studying the ruby & c code is just as effective as using a tool like gperftools
The text was updated successfully, but these errors were encountered:
Moved from: pry/pry#593
The original description:
The text was updated successfully, but these errors were encountered: