* [Buildroot] Python running very slow with buildroot 2012.05 @ 2012-09-06 14:04 Vimal Menon 2012-09-06 14:15 ` Thomas Petazzoni 0 siblings, 1 reply; 6+ messages in thread From: Vimal Menon @ 2012-09-06 14:04 UTC (permalink / raw) To: buildroot Dear Team, I happened to download and install buildroot (default 2012.05), while checking the compiled image, I saw that python runs very slow. for eg: On a standard linux, Python 2.7.2 complied with glibc #time python -c "print 'hello world'" hello world real??? 0m0.077s user??? 0m0.068s sys???? 0m0.009s and the same command ran on the same machine with the buildroot compiled image (not via qemu, but with the image booted through grub), python takes a lot more time #time python -c "print 'hello world'" hello world real??? 0m 0.28s user??? 0m 0.26s sys???? 0m 0.01s Why would there be such a huge difference? What might I have done wrong? Has anybody of you come across such a situation? Thanks, Vimal -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120906/694993f0/attachment-0001.html> ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] Python running very slow with buildroot 2012.05 2012-09-06 14:04 [Buildroot] Python running very slow with buildroot 2012.05 Vimal Menon @ 2012-09-06 14:15 ` Thomas Petazzoni 2012-09-06 14:27 ` Vimal Menon 0 siblings, 1 reply; 6+ messages in thread From: Thomas Petazzoni @ 2012-09-06 14:15 UTC (permalink / raw) To: buildroot Le Thu, 6 Sep 2012 07:04:01 -0700 (PDT), Vimal Menon <vimalmenon@yahoo.com> a ?crit : > I happened to download and install buildroot (default 2012.05), while > checking the compiled image, I saw that python runs very slow. for eg: > > On a standard linux, Python 2.7.2 complied with glibc > > #time python -c "print 'hello world'" > > hello world > > real??? 0m0.077s > user??? 0m0.068s > sys???? 0m0.009s > > and the same command ran on the same machine with the buildroot > compiled image (not via qemu, but with the image booted through > grub), python takes a lot more time > > #time python -c "print 'hello world'" > > hello world > real??? 0m 0.28s > user??? 0m 0.26s > sys???? 0m 0.01s > > Why would there be such a huge difference? What might I have done > wrong? Has anybody of you come across such a situation? You're not running the C library (by default, Buildroot uses uClibc), and maybe you're not using the same optimization flags as well. Try to build a Buildroot system based on glibc, and use the appropriate optimization flags, maybe it will improve the situation. Best regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] Python running very slow with buildroot 2012.05 2012-09-06 14:15 ` Thomas Petazzoni @ 2012-09-06 14:27 ` Vimal Menon 2012-09-06 14:34 ` Thomas Petazzoni 0 siblings, 1 reply; 6+ messages in thread From: Vimal Menon @ 2012-09-06 14:27 UTC (permalink / raw) To: buildroot Dear Thomas, I checked using default installations in both the environments, can the difference between glibc and uClibc be so huge for python? Thanks, Vimal ? ________________________________ From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> To: Vimal Menon <vimalmenon@yahoo.com> Cc: "buildroot at busybox.net" <buildroot@busybox.net> Sent: Thursday, September 6, 2012 7:45 PM Subject: Re: [Buildroot] Python running very slow with buildroot 2012.05 Le Thu, 6 Sep 2012 07:04:01 -0700 (PDT), Vimal Menon <vimalmenon@yahoo.com> a ?crit : > I happened to download and install buildroot (default 2012.05), while > checking the compiled image, I saw that python runs very slow. for eg: > > On a standard linux, Python 2.7.2 complied with glibc > > #time python -c "print 'hello world'" > > hello world > > real??? 0m0.077s > user??? 0m0.068s > sys???? 0m0.009s > > and the same command ran on the same machine with the buildroot > compiled image (not via qemu, but with the image booted through > grub), python takes a lot more time > > #time python -c "print 'hello world'" > > hello world > real??? 0m 0.28s > user??? 0m 0.26s > sys???? 0m 0.01s > > Why would there be such a huge difference? What might I have done > wrong? Has anybody of you come across such a situation? You're not running the C library (by default, Buildroot uses uClibc), and maybe you're not using the same optimization flags as well. Try to build a Buildroot system based on glibc, and use the appropriate optimization flags, maybe it will improve the situation. Best regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120906/2d0b73cc/attachment.html> ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] Python running very slow with buildroot 2012.05 2012-09-06 14:27 ` Vimal Menon @ 2012-09-06 14:34 ` Thomas Petazzoni 2012-09-06 14:40 ` Gustavo Zacarias 0 siblings, 1 reply; 6+ messages in thread From: Thomas Petazzoni @ 2012-09-06 14:34 UTC (permalink / raw) To: buildroot Hello, Le Thu, 6 Sep 2012 07:27:17 -0700 (PDT), Vimal Menon <vimalmenon@yahoo.com> a ?crit : > I checked using default installations in both the environments, can What do you mean by this? You're comparing the Python that has been built by your distro with a certain compiler and certain optimization flags, with the Python that has been built by Buildroot using a different compiler, with different optimization flags. > the difference between glibc and uClibc be so huge for python? I don't know. Maybe the dynamic linker is slower, maybe some other parts of the C library are slower, but I'm not sure, it needs investigation. Is is reproducible even after the first run? Are you running the same kernel, with the same configuration? Your two environments are really different, so it's very difficult to make correct comparisons and draw conclusions from them. Best regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] Python running very slow with buildroot 2012.05 2012-09-06 14:34 ` Thomas Petazzoni @ 2012-09-06 14:40 ` Gustavo Zacarias 2012-09-06 15:11 ` Thomas Petazzoni 0 siblings, 1 reply; 6+ messages in thread From: Gustavo Zacarias @ 2012-09-06 14:40 UTC (permalink / raw) To: buildroot On 09/06/12 11:34, Thomas Petazzoni wrote: > Is is reproducible even after the first run? Are you running the same > kernel, with the same configuration? Your two environments are really > different, so it's very difficult to make correct comparisons and draw > conclusions from them. Exactly where i was going to point to. He's basically measuring startup time, not a benchmark per se. Also if, say, the main system is already running something with the exact same glibc it's already preloaded, whereas if it's the first/only thing uclibc-based it gets all the penalties, even after the first run. Regards. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] Python running very slow with buildroot 2012.05 2012-09-06 14:40 ` Gustavo Zacarias @ 2012-09-06 15:11 ` Thomas Petazzoni 0 siblings, 0 replies; 6+ messages in thread From: Thomas Petazzoni @ 2012-09-06 15:11 UTC (permalink / raw) To: buildroot Le Thu, 06 Sep 2012 11:40:39 -0300, Gustavo Zacarias <gustavo@zacarias.com.ar> a ?crit : > Also if, say, the main system is already running something with the > exact same glibc it's already preloaded, whereas if it's the > first/only thing uclibc-based it gets all the penalties, even after > the first run. Regards. Aaah, good point. Most likely his Linux distro has gazillions of programs already running, so most of the glibc code is already in memory. If not parts of the Python interpreter code itself. While on the Buildroot system, no Python code has been executed since boot, and only a minimal set of userspace applications has been executed, so not much of uClibc code is in memory. But I would strongly suspect that the Linux distro is already running a Python app somewhere, so the Python interpreter is in memory already. Well, to conclude: you're comparing apples to oranges and you really cannot draw any conclusion from your "benchmark". Best regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-09-06 15:11 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-09-06 14:04 [Buildroot] Python running very slow with buildroot 2012.05 Vimal Menon 2012-09-06 14:15 ` Thomas Petazzoni 2012-09-06 14:27 ` Vimal Menon 2012-09-06 14:34 ` Thomas Petazzoni 2012-09-06 14:40 ` Gustavo Zacarias 2012-09-06 15:11 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox