On 2014-12-02 17:08:25, SREZIC wrote:
Show quoted text> I think the get_shortest_route() performance can be greatly improved
> by using an alternative route search algorithm, e.g. A*.
It looks like there's a performance regression between Map::Tube 2.26 and 2.27.
With 2.26:
$ time perl5.12.5 -MMap::Tube::London -E '$t = Map::Tube::London->new; say $t->get_shortest_route("Aldgate","Bayswater")'
Aldgate, Liverpool Street, Bank, Waterloo, Westminster, Green Park, Bond Street, Marble Arch, Lancaster Gate, Queensway, Notting Hill Gate, Bayswater
perl5.12.5 -MMap::Tube::London -E 0.10s user 0.03s system 81% cpu 0.152 total
With 2.27:
$ time perl5.12.5 -MMap::Tube::London -E '$t = Map::Tube::London->new; say $t->get_shortest_route("Aldgate","Bayswater")'
Aldgate (Circle,Metropolitan), Liverpool Street (Central,Circle,Hammersmith & City,Metropolitan), Bank (Central,Northern,Waterloo & City), Waterloo (Northern,Bakerloo,Jubilee,Waterloo & City), Westminster (Circle,District,Jubilee), Green Park (Victoria,Jubilee,Piccadilly), Bond Street (Central,Jubilee), Marble Arch (Central), Lancaster Gate (Central), Queensway (Central), Notting Hill Gate (Central,Circle,District), Bayswater (Circle,District)
perl5.12.5 -MMap::Tube::London -E 47.78s user 0.03s system 99% cpu 47.818 total