Skip to content

missing projectId in @googlemaps clients causes crazy slow requests #6935

@timm-stelzer-e-farm

Description

@timm-stelzer-e-farm

Please make sure you have searched for information in the following guides.

A screenshot that you have tested with "Try this API".

I don't know what I'm supposed to provide in this field.

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://github.com/timm-stelzer-e-farm/reproduce-slow-google-apis

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

Follow the steps in the repository README and observe the terminal output.

A clear and concise description of what the bug is, and what you expected to happen.

Omitting the projectId when constructing clients from @googlemaps/* (well, I only tested with routing and places), and only using an apiKey leads to incredibly slow and inconsistent requests. I've seen individual requests take up to 16s. The base-line seems to be between 3-4s.

When passing the projectId, in addition to the apiKey, the requests are reasonably fast, e.g. between 150ms and 400ms.

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

It is not clear to me why not passing the projectId would cause this behavior, especially since the requests are evidently working without it (they are just slow AF).

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-important priority. Fix may not be included in next release.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions