Hacker News new | past | comments | ask | show | jobs | submit login

Nice work, although it is a bit slow: (avg 5 seconds per address parsing)

date && perl geo.pl && date Sat Dec 29 16:18:30 UTC 2018 country => united kingdom suburb => shoreditch house => the book club city => london postcode => ec2a 4rh road => leonard st house_number => 100-106 Sat Dec 29 16:18:35 UTC 2018




It seems to have a whole lot of data that would probably need to be loaded. Maybe a lot of that time is spent in initialization. Is it faster at parsing a second, third, etc. address once loaded?

By the way, a more convenient way to benchmark Perl:

    perl -MBenchmark -e 'timethis(500, sub { ... your code here ... });'


You are correct. Only the first request takes about 4-5 seconds:

Start libpostal: Chong Co Thai Restaurant and Bar Shop 0039A Grand Central Shopping Centre 1-7 Dent St Toowoomba QLD 4350

house => chong co thai restaurant and bar shop 0039a grand central shopping centre

city => toowoomba

postcode => 4350

road => dent st

state => qld

house_number => 1-7

1: 4.10454607009888 seconds

Start libpostal: Little Plate Shop 9 11 Deodar Drive Burliegh Heads QLD 4220

house => little plate shop

city => heads

postcode => 4220

road => deodar drive burliegh

state => qld

house_number => 9 11

2: 0.000234127044677734 seconds

Start libpostal: Sheoak Shack Gallery Cafe 64 Fingal Rd Fingal Head NSW 2487

suburb => fingal head

house => sheoak shack gallery cafe

postcode => 2487

road => fingal rd

state => nsw

house_number => 64

3: 0.000188827514648438 seconds

Start libpostal: Chong Co Thai Restaurant and Bar Shop 0039A Grand Central Shopping Centre 1-7 Dent St Toowoomba QLD 4350

house => chong co thai restaurant and bar shop 0039a grand central shopping centre

city => toowoomba

postcode => 4350

road => dent st

state => qld

house_number => 1-7

4: 0.000257015228271484 seconds




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: