Scaling API-first – The story of a global engineering organization
Optimizando e as-meta
1. Optimizing evolutionary algorithms
at program level
JJ Merelo, A. M. Mora, Pedro Castillo,
Juan L. Jiménez Laredo, Carlos Fernandes
GeNeura team: http://geneura.wordpress.com
Departamento de Arquitectura y Tecnología de
Computadores: http://atc.ugr.es
University of Granada: http://www.ugr.es
2. Evolutionary Algorithms
EAs are population-based algorithms that
rely on a certain number of parameters and
operators
Best parameter values and competence of
operators are well studied.
We know the limits of the EAs scalability
However…
3. Little attention is devoted to
evolutionary algorithm
implementation
Even as it allows to design better algorihtms and
obtain substantial improvement at the algorithm
and runtime level
8. Size always matters
Caché for
fitness
computations
Use of the tr
Perl-specific
function for
computing
fitness
9. If we are more, we'll take more
Using a profiler for
finding a bottleneck:
the sort function
Change by
Sort::Key
It improves worst-case
behavior.
Blue uses previous
slide function
10. Conclusions
Running time improves up to two orders of
magnitude (for some population sizes) through
changes in implementation.
It is convenient to always bear in mind usual
programming techniques and good practices.
Future work: apply this to complex EA libraries
such as Algorithm::Evolutionary, written in Perl,
and other languages (Lua)
La imagen está tomada de http://www.flickr.com/photos/dahlstroms/4083220012/
Imagen obtenida de http://www.flickr.com/photos/sebilden/3429805384/
Devel::NYTProf, un profiler para Perl desarrollado inicialmente para trabajar en el NYTimes (de ahí el nombre) y liberado; actualmente disponible en CPAN; es la mejor herramienta y más detallada que hay ahora mismo en Perl, produciendo una salida en HTML.
Imagen CC obtenida de http://www.flickr.com/photos/rbanks/2292915/
En el repositorio se pueden ver como diferentes versiones del mismo programa todos los programas que se han usado en la serie, usando la herramienta de diferencia entre programas que da Launchpad.
The use of caché decreases running time by a constant, which is approximately the percentage of chromosomes that are generated repeatedly during the evolutionary algorithm. This gives also some insight over the algorithm itself: the one we're using is generating repeated chromosomes, independently of size.
On the other hand, using tr, which is a function that translates letters in a string to other letters; in this case, 1 to nothing. As a side effect, it returns the number of translations. This is quite efficient since it runs over the string only once, and it does so in machine code, not language code. This means that, even as running time increases linearly with chromosome size, it does so less steeply
No es la única mejora, se probaron también otros algoritmos como mergesort, y otros que no tuvieron tanto éxito. El comportamiento de los lenguajes de programación