1 |
NAME |
2 |
Faster - do some things faster |
3 |
|
4 |
SYNOPSIS |
5 |
use Faster; |
6 |
|
7 |
perl -MFaster ... |
8 |
|
9 |
DESCRIPTION |
10 |
This module implements a very simple-minded JIT. It works by more or |
11 |
less translating every function it sees into a C program, compiling it |
12 |
and then replacing the function by the compiled code. |
13 |
|
14 |
As a result, startup times are immense, as every function might lead to |
15 |
a full-blown compilation. |
16 |
|
17 |
The speed improvements are also not great, you can expect 20% or so on |
18 |
average, for code that runs very often. |
19 |
|
20 |
Faster is in the early stages of development. Due to its design its |
21 |
relatively safe to use (it will either work or simply slowdown the |
22 |
program immensely, but rarely cause bugs). |
23 |
|
24 |
Usage is very easy, just "use Faster" and every function called from |
25 |
then on will be compiled. |
26 |
|
27 |
Right now, Faster will leave lots of *.c, *.o and *.so files in your |
28 |
$FASTER_CACHEDIR (by default $HOME/.perl-faster-cache), and it will even |
29 |
create those temporary files in an insecure manner, so watch out. |
30 |
|
31 |
ENVIRONMENT VARIABLES |
32 |
The following environment variables influence the behaviour of Faster: |
33 |
|
34 |
FASTER_VERBOSE |
35 |
Faster will output more informational messages when set to values |
36 |
higher than 0. Currently, 1 outputs which packages are being |
37 |
compiled, 3 outputs the cache directory and 10 outputs information |
38 |
on which perl function is compiled into which shared object. |
39 |
|
40 |
FASTER_DEBUG |
41 |
Add debugging code when set to values higher than 0. Currently, this |
42 |
adds 1-3 "assert"'s per perl op, to ensure that opcode order and C |
43 |
execution order are compatible. |
44 |
|
45 |
FASTER_CACHE |
46 |
Set a persistent cache directory that caches compiled code |
47 |
fragments. The default is "$HOME/.perl-faster-cache" if "HOME" is |
48 |
set and a temporary directory otherwise. |
49 |
|
50 |
This directory will always grow in size, so you might need to erase |
51 |
it from time to time. |
52 |
|
53 |
BUGS/LIMITATIONS |
54 |
Perl will check much less often for asynchronous signals in |
55 |
Faster-compiled code. It tries to check on every function call, loop |
56 |
iteration and every I/O operator, though. |
57 |
|
58 |
The following things will disable Faster. If you manage to enable them |
59 |
at runtime, bad things will happen. Enabling them at startup will be |
60 |
fine, though. |
61 |
|
62 |
enabled tainting |
63 |
enabled debugging |
64 |
|
65 |
Thread-enabled builds of perl will dramatically reduce Faster's |
66 |
performance, but you don't care about speed if you enable threads |
67 |
anyway. |
68 |
|
69 |
These constructs will force the use of the interpreter for the currently |
70 |
executed function as soon as they are being encountered during |
71 |
execution. |
72 |
|
73 |
goto |
74 |
next, redo (but not well-behaved last's) |
75 |
eval |
76 |
require |
77 |
any use of formats |
78 |
.., ... (flipflop operators) |
79 |
|
80 |
AUTHOR |
81 |
Marc Lehmann <schmorp@schmorp.de> |
82 |
http://home.schmorp.de/ |
83 |
|