Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache / preprocess heatmap response data #58

Open
iori-yja opened this issue Sep 25, 2018 · 3 comments
Open

cache / preprocess heatmap response data #58

iori-yja opened this issue Sep 25, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@iori-yja
Copy link
Contributor

iori-yja commented Sep 25, 2018

Every time people access the flamescope's heatmap, the server processes the perf output data which makes the user awaited. So I am considering to cache preprocessed or first-returned data.

Structure of the response is quite simple;

{
    "columns": [0, 1, .....],
    "rows": [980, 960....],
    "values": [ [2, 2, ...], [...], [...], ....],
    "maxvalue": 16,
}

The most quick hack to cache it is storing in sessionStorage in local browser. Better idea is to save the data as a metadata beside actual data (In that case, we need to decide naming convention for metadata). Other idea is to store data in DB.

I am going to implement a cache anyway, but I want to ask this before starting, which is, what kind of cache is easier to accept for you?.

@spiermar
Copy link
Contributor

spiermar commented Sep 28, 2018

When you mention cache, is that from going back and forth between the heatmap and flame graph visualization, or changing profiles? Browser session storage might work, but it's very limited. A preprocessed output might be stored next to the actual profile files, in disk. I would avoid adding an external dependency, like a database, since one of the goals is to have a solution that is very simple to deploy.

@spiermar spiermar changed the title How should cache / preprocess heatmap response data look like? cache / preprocess heatmap response data Sep 28, 2018
@spiermar
Copy link
Contributor

Preprocess in the other hand is a different problem. I definitely wouldn't do it in the browser session storage, given the size limits, but might be Ok to have a task to preprocess all heatmaps and store them on disk.

@spiermar spiermar added the enhancement New feature or request label Sep 28, 2018
@iori-yja
Copy link
Contributor Author

iori-yja commented Oct 4, 2018

My scope is only on the processing time when user is "going back and forth between the heatmap and flame graph" or just opening one of them.

I agree with you on both points of avoiding using databases and browser storages for each reason. I will move on to this in a few weeks. Is it OK to be default behavior to store preprocessed data next to the profile? I don't want to have a slow start-up time, so it should be to keep the first response rather than preprocessing all data files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants