Bug 15796 - Touch running TinySC seems less responsive than with previous builds
: Touch running TinySC seems less responsive than with previous builds
Status: RESOLVED WONTFIX
Product: SB Touch
Classification: Unclassified
Component: TinySC
: 7.5.0
: All Windows XP
: P1 normal (vote)
: 7.5.0
Assigned To: Mickey Gee
:
Depends on: 15779
Blocks:
  Show dependency treegraph
 
Reported: 2010-02-26 16:51 UTC by Mickey Gee
Modified: 2010-03-11 09:18 UTC (History)
5 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickey Gee 2010-02-26 16:51:57 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.
Comment 1 Andy Grundman 2010-02-26 17:11:43 UTC
I made some improvements today so try again with tomorrow's build.  I am hoping we don't have a general slowdown issue.
Comment 2 Chris Owens 2010-03-01 09:42:10 UTC
Mickey is still looking for firmware builds to try to determine when the slowdown happened.
Comment 3 Andy Grundman 2010-03-02 14:13:06 UTC
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
Comment 4 Andy Grundman 2010-03-02 14:15:00 UTC
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)
Comment 5 SVN Bot 2010-03-02 15:03:56 UTC
 == 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
Comment 6 Andy Grundman 2010-03-02 19:14:17 UTC
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.
Comment 7 Alan Young 2010-03-02 22:20:12 UTC
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.
Comment 8 Andy Grundman 2010-03-03 04:25:46 UTC
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.
Comment 9 Alan Young 2010-03-03 04:42:07 UTC
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
Comment 10 Mickey Gee 2010-03-03 15:56:23 UTC
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.
Comment 11 Andy Grundman 2010-03-03 16:00:14 UTC
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.
Comment 12 Alan Young 2010-03-03 23:18:44 UTC
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.
Comment 13 Andy Grundman 2010-03-04 04:35:56 UTC
IMO it's absolutely worth it, we need Perl to be as fast as possible.
Comment 14 Andy Grundman 2010-03-08 07:57:56 UTC
How's it now Mickey?
Comment 15 Mickey Gee 2010-03-09 12:22:53 UTC
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.
Comment 16 Chris Owens 2010-03-11 09:18:19 UTC
We can review