Bug 123750 - Web Inspector: localStorage inspector very slow on big values
Summary: Web Inspector: localStorage inspector very slow on big values
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: https://test2.wikipedia.org
Keywords: InRadar
Depends on:
Reported: 2013-11-04 11:18 PST by Derk-Jan Hartman
Modified: 2016-02-22 03:38 PST (History)
4 users (show)

See Also:

[PATCH] Proposed Fix (6.69 KB, patch)
2016-02-09 14:25 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Derk-Jan Hartman 2013-11-04 11:18:36 PST
Currently Wikipedia is testing caching JavaScript in localStorage.

In testing this, I noticed that trying to inspect localStorage using Safari becomes almost impossible. When trying to represent the value in the inspector, it seems to want to display the entire value in the row, which takes upto a minute.

The inspector should be smarter about this and recognize that a very big value is not fully suite to be represented like this, but should be shown using a file like representation.
Comment 1 Radar WebKit Bug Importer 2013-11-04 11:18:46 PST
Comment 2 Timothy Hatcher 2013-11-04 11:36:28 PST
I agree, the current presentation does not live up how people are using LocalStorage now. Even the Inspector itself dumps large values into LocalStorage that it can't show. Detecting large values and letting you view them full-view would be great.

Thanks for the bug and Wikipedia test case!
Comment 3 Derk-Jan Hartman 2015-02-19 00:33:21 PST
still a problem
Comment 4 Derk-Jan Hartman 2015-06-30 13:15:48 PDT
This seems possibly even worse in Safari 9 beta.
Comment 5 Joseph Pecoraro 2015-06-30 13:26:10 PDT
Since DOMStorage has string keys/values how about we snip the strings to something like 50-100 characters.


    window.localStorage.key = "Really really really really really really long string";

The inspector could show something like:

    | "key" | "Really really really..." |

With some way to fetch the completely value. This is similar to RemoteObject previews, which abbreviates strings to 100 characters.
Comment 6 Timothy Hatcher 2015-06-30 15:02:13 PDT
Sounds great to me!
Comment 7 Derk-Jan Hartman 2016-02-09 13:52:31 PST
This crash still happens, and it still annoys me about once a week, when I accidentally press the localStorage tab on a wikipedia and related websites.
Comment 8 Joseph Pecoraro 2016-02-09 14:25:54 PST
Created attachment 270954 [details]
[PATCH] Proposed Fix
Comment 9 Joseph Pecoraro 2016-02-09 14:26:49 PST
One thing worth considering is that we could have the backend truncate before sending to the frontend, avoiding sending megabytes of text over the protocol. However, we may want to update how we display things in the frontend, so this just leaves it a frontend decision to truncate for display only.
Comment 10 WebKit Commit Bot 2016-02-09 15:42:55 PST
Comment on attachment 270954 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 270954

Committed r196342: <http://trac.webkit.org/changeset/196342>
Comment 11 WebKit Commit Bot 2016-02-09 15:42:57 PST
All reviewed patches have been landed.  Closing bug.
Comment 12 Derk-Jan Hartman 2016-02-22 03:38:27 PST
Tested in nightly. Works like a charm !!
I'm super happy with this change, thx so much for listening.