From: "M. Edward (Ed) Borasky" Date: 2007-09-05T13:04:35+09:00 Subject: Re: Ruby is much slower on linux when compiled with --enable-pthread? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jeffrey 'jf' Lim wrote: > On 9/5/07, M. Edward (Ed) Borasky wrote: >> What I would suggest is >> compiling Ruby with profiling and seeing where in the Ruby interpreter >> these calls are. >> > > any idea how you would do that? Don't see anything in the configure > switches for compiling ruby (1.8.6)... > > -jf > > -- > In the meantime, here is your PSA: > "It's so hard to write a graphics driver that open-sourcing it would not help." > -- Andrew Fear, Software Product Manager, NVIDIA Corporation > http://kerneltrap.org/node/7228 > > Before you "configure", type export CFLAGS='-g -pg' Then do ./configure make as normal. You will have a profiling Ruby executable. Every time you run the profiling Ruby interpreter, you will get a file called "gmon.out" which contains a binary profile. Then run export GPROF_PATH=/path/to/ruby/source gprof /path/to/ruby/executable > profile.txt gprof -A /path/to/ruby/executable > annotated-source.txt The "profile.txt" will give a call-graph profile of Ruby executing your script, and "annotated-source.txt" will have a source listing of Ruby with execution counts for all the lines. A word of warning -- this compiles with no optimization at all, and can be much slower as Ruby compiled with optimization. The call graph should be all you need to determine where the system call is coming from. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG3irB8fKMegVjSM8RAj3FAKDElDD+blUEIYK5IvG3rQe9UGsARQCg2Evn jxbv8oYmkLNr9ZC8hdWkNNo= =A2/g -----END PGP SIGNATURE-----