Bugzilla – Bug 15796
Touch running TinySC seems less responsive than with previous builds
Last modified: 2010-03-11 09:18:19 UTC
Running Touch with TinySC and USB hard drive. With build r8593, everything seems less responsive than it used to when playing tracks from the connected USB hard drive. I haven't played tracks with TinySC/USB drive for perhaps 1-2 weeks, so the difference is noticeable. This is mostly experienced on the Now Playing screen. For example, when you press the Repeat button, it doesn't indicate Repeat ON immediately. Also, when pressing FWD the input seems to be sensed after a few seconds. I tried connecting to same USB drive connected to laptop running big SC. Much faster and snappier.
I made some improvements today so try again with tomorrow's build. I am hoping we don't have a general slowdown issue.
Mickey is still looking for firmware builds to try to determine when the slowdown happened.
I did some benchmarks comparing the Perl performance of r8471 (pre-toolchain/optimize changes) and today's r8610. Perl is overall somewhat slower now than it used to be. Need to experiment with changing the optimization settings used for Perl + all Perl modules. Also need to find better benchmarks, these probably aren't the best tests for us. r8471 - Feb 10 /usr/bin/perl5.10.0 - 808256 bytes jive not running # perl -I/usr/squeezecenter/CPAN bench < short.json module | encode | decode | --------------|------------|------------| JSON::XS | 15022.579 | 12108.268 | JSON::XS/2 | 11161.001 | 11795.006 | JSON::XS/3 | 13164.796 | 11631.459 | Storable | 1847.711 | 5611.860 | --------------+------------+------------+ # perl -I/usr/squeezecenter/CPAN bench < long.json module | encode | decode | --------------|------------|------------| JSON::XS | 785.039 | 271.666 | JSON::XS/2 | 522.251 | 272.393 | JSON::XS/3 | 736.696 | 268.010 | Storable | 557.486 | 266.922 | --------------+------------+------------+ # time perl nbody.pl 50000 real 0m 48.46s # time perl fasta.pl 250000 >/dev/null real 1m 14.79s # time perl binary-trees.pl 12 real 0m 52.99s ===================================================== r8610 - March 2 /usr/bin/perl5.10.0 - 718528 bytes jive not running # perl -I/usr/squeezecenter/CPAN bench < short.json module | encode | decode | --------------|------------|------------| JSON::XS | 12850.196 | 11631.459 | JSON::XS/2 | 9841.164 | 11360.520 | JSON::XS/3 | 11657.321 | 11317.604 | Storable | 2012.815 | 5393.909 | --------------+------------+------------+ # perl -I/usr/squeezecenter/CPAN bench < long.json module | encode | decode | --------------|------------|------------| JSON::XS | 602.907 | 265.998 | JSON::XS/2 | 403.291 | 264.185 | JSON::XS/3 | 578.636 | 262.617 | Storable | 539.724 | 261.383 | --------------+------------+------------+ # time perl nbody.pl 50000 real 0m 49.79s # time perl fasta.pl 250000 >/dev/null real 1m 20.13s # time perl binary-trees.pl 12 real 0m 55.13s
BTW the Perl benchmarks I used are from http://shootout.alioth.debian.org/u32q/perl.php And the JSON::XS bench is http://cpansearch.perl.org/src/MLEHMANN/JSON-XS-2.27/eg/bench (modified to remove the other modules)
== Auto-comment from SVN commit #8614 to the jive repo by agrundman == == https://svn.slimdevices.com/jive?view=revision&revision=8614 == Bug 15796, try setting default FULL_OPTIMIZATION for all Perl binaries
I fixed the perl build and rebuilt all modules to use -O2 and the default optimizations. It now seems to be slightly faster than the old pre-toolchain-change build.
Andy, would it not just have been possible to set the full optimization in cpan.bbclass for all the modules? Did you check the memory footprint comparison between the two builds? We could even try -O3 but I would hesitate to go there at this late stage in the project.
I didn't think of using cpan.bbclass. Another option would be disabling thumb, but I think that would probably use too much memory. A quick check of memory use with top didn't show any problem with the -O2 files.
I did do a bunch of comparative performance tests between ARM and Thumb instruction sets with the previous toolchain. The results were not conclusive but generally thumb was a little faster. The new toolchain is supposed to have quite a bit in the way of thumb-specific code generation improvements but I guess there will still be some modules where ARM would be better. It is reasonably easy to override which instruction set to use for individual poky recipes but I would be reluctant to do so in general. It is interesting that perl is c. 2.8MB of code and just the SQLite module is 1.6MB. These sizes are in 4KiB pages: 696 /usr/bin/perl5.10.0 8 /usr/lib/perl/5.10.0/auto/Cwd/Cwd.so 8 /usr/lib/perl/5.10.0/auto/Fcntl/Fcntl.so 60 /usr/lib/perl/5.10.0/auto/POSIX/POSIX.so 20 /usr/lib/perl/5.10.0/auto/Time/HiRes/HiRes.so 76 /usr/lib/perl5/auto/DBI/DBI.so 20 /usr/lib/perl/5.10.0/auto/List/Util/Util.so 92 /usr/lib/perl5/auto/EV/EV.so 44 /usr/lib/perl5/auto/XML/Parser/Expat/Expat.so 28 /usr/lib/perl5/auto/HTML/Parser/Parser.so 28 /usr/lib/perl5/auto/JSON/XS/XS.so 12 /usr/lib/perl5/auto/Digest/SHA1/SHA1.so 68 /usr/lib/perl5/auto/YAML/Syck/Syck.so 12 /usr/lib/perl/5.10.0/auto/IO/IO.so 64 /usr/lib/perl5/auto/GD/GD.so 8 /usr/lib/perl5/auto/Sub/Name/Name.so 24 /usr/lib/perl/5.10.0/auto/Encode/Encode.so 12 /usr/lib/perl/5.10.0/auto/Encode/Unicode/Unicode.so 44 /usr/lib/perl/5.10.0/auto/Storable/Storable.so 12 /usr/lib/perl/5.10.0/auto/Digest/MD5/MD5.so 12 /usr/lib/perl/5.10.0/auto/Socket/Socket.so 12 /usr/lib/perl/5.10.0/auto/MIME/Base64/Base64.so 432 /usr/lib/perl5/auto/DBD/SQLite/SQLite.so 12 /usr/lib/perl/5.10.0/auto/Sys/Syslog/Syslog.so 8 /usr/lib/perl5/auto/Linux/Inotify2/Inotify2.so 48 /usr/lib/perl5/auto/IO/AIO/AIO.so 12 /usr/lib/perl/5.10.0/auto/Devel/Peek/Peek.so 84 /usr/lib/perl5/auto/Compress/Raw/Zlib/Zlib.so 16 /usr/lib/perl/5.10.0/auto/PerlIO/encoding/encoding.so Total 1972
Now running TinySC with r8622. It now seems better, but definitely not as snappy as it used to be. Here are some concrete examples: Now Playing with VU meters: Pressing REW will take approximately 6 seconds to go to the beginning of the track, and then take an additional 6 seconds for the track time remaining/time passed values to catch up. Pressing the Repeat button can take 3-5 seconds to change its visual state. Now Playing default: Pressing REW mmediately goes to beginning of track, 5 seconds for time remaing/passed and visual track indicator to catch up. 2 seconds for Repeat indicator to change visual state. Switching to different album results in Now Playing title/artist/track name info changing in 12 seconds, album art cover for Now Playing changes in 20 seconds. Even with the best times, it feels sluggish. I don't think it needs to be super snappy, but this is below my threshold.
The large album art will always be slow, it has to be resized before it can be displayed. Hopefully after statusQuery is optimized the status query updates will be faster.
Here are the code segment sizes from r8622: 844 /usr/bin/perl5.10.0 8 /usr/lib/perl/5.10.0/auto/Cwd/Cwd.so 8 /usr/lib/perl/5.10.0/auto/Fcntl/Fcntl.so 68 /usr/lib/perl/5.10.0/auto/POSIX/POSIX.so 20 /usr/lib/perl/5.10.0/auto/Time/HiRes/HiRes.so 88 /usr/lib/perl5/auto/DBI/DBI.so 20 /usr/lib/perl/5.10.0/auto/List/Util/Util.so 104 /usr/lib/perl5/auto/EV/EV.so 48 /usr/lib/perl5/auto/XML/Parser/Expat/Expat.so 36 /usr/lib/perl5/auto/HTML/Parser/Parser.so 36 /usr/lib/perl5/auto/JSON/XS/XS.so 16 /usr/lib/perl5/auto/Digest/SHA1/SHA1.so 84 /usr/lib/perl5/auto/YAML/Syck/Syck.so 12 /usr/lib/perl/5.10.0/auto/IO/IO.so 72 /usr/lib/perl5/auto/GD/GD.so 8 /usr/lib/perl5/auto/Sub/Name/Name.so 100 /usr/lib/perl5/auto/Audio/Scan/Scan.so 28 /usr/lib/perl/5.10.0/auto/Encode/Encode.so 12 /usr/lib/perl/5.10.0/auto/Encode/Unicode/Unicode.so 4 /usr/lib/perl/5.10.0/auto/Sys/Hostname/Hostname.so 48 /usr/lib/perl/5.10.0/auto/Storable/Storable.so 12 /usr/lib/perl/5.10.0/auto/Digest/MD5/MD5.so 16 /usr/lib/perl/5.10.0/auto/Socket/Socket.so 36 /usr/lib/perl5/auto/Class/XSAccessor/XSAccessor.so 12 /usr/lib/perl/5.10.0/auto/MIME/Base64/Base64.so 432 /usr/lib/perl5/auto/DBD/SQLite/SQLite.so 12 /usr/lib/perl/5.10.0/auto/Sys/Syslog/Syslog.so 8 /usr/lib/perl5/auto/Linux/Inotify2/Inotify2.so 52 /usr/lib/perl5/auto/IO/AIO/AIO.so 12 /usr/lib/perl/5.10.0/auto/Devel/Peek/Peek.so 104 /usr/lib/perl5/auto/Compress/Raw/Zlib/Zlib.so 2360 In total 1.5MB more that with -Os. I'm not sure that a 5-20% speed improvement is worth that much memory.
IMO it's absolutely worth it, we need Perl to be as fast as possible.
How's it now Mickey?
Performance appears better with r8639. Repeat button changes state much faster if it isn't in trying to display cover art. FWD definitely seems faster and more immediate. Overall, it's better. It doesn't meet my personal threshold of being snappy enough, but it's gotten closer. Now Playing with VU meters: Pressing REW will jump immediately to the beginning of the track, and then take an additional 6 seconds for the track time remaining/time passed values to catch up. Pressing the Repeat button can take 3-5 seconds to change its visual state. Now Playing default: Pressing REW immediately goes to beginning of track, 4 seconds for time remaing/passed and visual track indicator to catch up. 2 seconds for Repeat indicator to change visual state.
We can review