schollz / howmanypeoplearearound

Count the number of people around you :family_man_man_boy: by monitoring wifi signals :satellite:
MIT License
6.92k stars 386 forks source link

Accelerate analysis by loading file once, not twice #16

Closed cclauss closed 7 years ago

schollz commented 7 years ago

@cclauss Something is wrong with this change...it runs much much slower.

When I run howmanypeoplearearound -z file.json using this patch it it takes about 10 seconds before it even starts the server. The current version only takes ~ 1 second.

cclauss commented 7 years ago

Sorry. The set() trick is usually superfast but in this case, the unnecessary append()s added up.

schollz commented 7 years ago

Great thanks!