Skip to content

Commit be235bf

Browse files
committed
Yet more tweaks
1 parent cf44bb7 commit be235bf

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

doc/Language/performance.pod

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
55
=SUBTITLE Measuring and improving run-time or compile-time performance
66
7-
A simple take on performance is "speed and ram usage". According to wikipedia,
8-
L<Computer Performance|https://en.wikipedia.org/wiki/Computer_Performance> is
9-
"characterized by the amount of useful work accomplished by a computer system or
10-
computer network compared to the time and resources used.".
7+
This page is about anything to do with L<computer performance|https://en.wikipedia.org/wiki/Computer_Performance>
8+
in the context of Perl 6.
119
1210
=head1 First, clarify the problem
1311
@@ -65,7 +63,7 @@ Use L<perl6-bench|https://github.com/japhb/perl6-bench>.
6563
If you run perl6-bench for multiple compilers (typically versions of Perl 5, Perl 6, or NQP)
6664
then results for each are visually overlaid on the same graphs to provide for quick and easy comparison.
6765
68-
=head2 Share the problem
66+
=head2 Share problems
6967
7068
Once you've used the above techniques to pinpoint code and performance that really matters you're in
7169
a good place to share problems, one at a time:
@@ -79,7 +77,7 @@ What if it took a month for folk to help you achieve that? A year?
7977
8078
=item Let folk know if your Perl 6 use-case is in a production setting or just for fun.
8179
82-
=head1 Solve the problem
80+
=head1 Solve problems
8381
8482
This bears repeating: B<make sure you're not wasting time on the wrong code>.
8583
Start by identifying the L<"critical 3%"|https://en.wikiquote.org/wiki/Donald_Knuth> of your code.
@@ -104,11 +102,12 @@ The call overhead of having multiple C<foo> definitions is generally insignifica
104102
of C<where> below), so if your new definition handles its particular case more quickly/leanly than the
105103
previously existing set of definitions then you probably just made your code that much faster/leaner for that case.
106104
107-
=head2 Type-checks and call resolution
105+
=head2 Speed up type-checks and call resolution
108106
109107
Most L<C<where> clauses|/type/Signature#Type_Constraints> -- and thus most
110-
L<subtypes|http://design.perl6.org/S12.html#Types_and_Subtypes> -- force dynamic (run-time)
111-
type checking and call resolution. This is slower, or at least later, than compile-time.
108+
L<subsets|http://design.perl6.org/S12.html#Types_and_Subtypes> -- force dynamic (run-time)
109+
type checking and call resolution for any call it I<might> match. This is slower, or at least later,
110+
than compile-time.
112111
113112
Method calls are generally resolved as late as possible, so dynamically, at run-time,
114113
whereas sub calls are generally resolvable statically, at compile-time.
@@ -156,15 +155,15 @@ A "lazy" approach often performs much better:
156155
157156
This loop pulls just one line from 'largefile.txt', immediately processes it, then gets the next, and so on.
158157
159-
=head3 Changing sequential/blocking code to parallel/non-blocking
158+
=head3 Change sequential/blocking code to parallel/non-blocking
160159
161160
This is another very important class of algorithmic improvement.
162161
163162
See the slides for
164163
L<Parallelism, Concurrency, and Asynchrony in Perl 6|http://jnthn.net/papers/2015-yapcasia-concurrency.pdf#page=17>
165164
and/or L<the matching video|https://www.youtube.com/watch?v=JpqnNCx7wVY&list=PLRuESFRW2Fa77XObvk7-BYVFwobZHdXdK&index=8>.
166165
167-
=head2 Using native types
166+
=head2 Use native types
168167
169168
You may be able to make some code run faster and/or use less ram by adding native types to your code:
170169
@@ -176,7 +175,7 @@ XXX Start of section to be written
176175
177176
XXX End of section to be written
178177
179-
=head2 Using existing high performance code
178+
=head2 Use existing high performance code
180179
181180
Is there an existing high (enough) performance implementation of what you're trying to speed up / slim down?
182181
@@ -193,11 +192,12 @@ L<use Perl 5 modules in Perl 6|http://stackoverflow.com/a/27206428/1077672>.
193192
More generally, Perl 6 is designed to be able to smoothly interop with other languages and there are a number
194193
of L<modules aimed at providing convenient use of libs from other langs|http://modules.perl6.org/#q=inline>.
195194
196-
=head2 Speeding up Rakudo itself
195+
=head2 Make the Rakudo compiler generate faster code
197196
198-
The focus to date (Feb 2016) regarding the compiler has been correctness, not speed, but that's expected to
199-
change somewhat this year and beyond. You can talk to compiler devs on the freenode IRC channels #perl6 and
200-
#moarvm about what to expect. Or you can contribute yourself:
197+
The focus to date (Feb 2016) regarding the compiler has been correctness, not how fast it generates code or,
198+
more importantly, how fast or lean the code it generates runs. But that's expected to change somewhat this
199+
year and beyond. You can talk to compiler devs on the freenode IRC channels #perl6 and #moarvm about what
200+
to expect. Better still you can contribute yourself:
201201
202202
=item Rakudo is largely written in Perl 6. So if you can write Perl 6, then you can hack on the compiler,
203203
including optimizing any of the large body of existing high-level code that impacts the speed of your code

0 commit comments

Comments
 (0)