Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
LocalStorage/SessionStorage set/remove
(version: 0)
Comparing performance of:
LocalStorage set vs SessionStorage set
Created:
3 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var onek = 'x'.repeat(1024)
Tests:
LocalStorage set
localStorage.setItem('foo', onek); localStorage.removeItem('foo');
SessionStorage set
sessionStorage.setItem('foo', onek); sessionStorage.removeItem('foo');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
LocalStorage set
SessionStorage set
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
Measuring the performance of JavaScript microbenchmarks can be a complex task, but let's break it down step by step. **What is being tested?** The provided benchmark tests two different ways to remove data from local storage: `localStorage` and `sessionStorage`. The test creates a large string (`onek`) using the `repeat()` method and stores it in both local storage and session storage. Then, it removes the string from both storage systems. **Options compared:** Two options are being compared: 1. **Local Storage**: Stores data locally on the client-side (in the browser's memory). Data is lost when the browser is closed. 2. **Session Storage**: Similar to local storage but stores data in a way that it is deleted when the user closes the browser, not when the tab or window is closed. **Pros and Cons of each approach:** * **Local Storage**: + Pros: - Fast access times - No additional overhead for storing and retrieving data + Cons: - Data is lost when the browser is closed - Limited storage capacity * **Session Storage**: + Pros: - Data persists even after the user closes the browser (but not tab/window) - More suitable for applications where user data needs to be retained across sessions + Cons: - Slower access times compared to local storage - Additional overhead for storing and retrieving data **Library/Technology Used:** The benchmark uses the `repeat()` method from JavaScript's built-in string methods. The purpose of this method is to create a new string consisting of a number of repeated occurrences of the original string. **Special JS feature/Syntax:** There is no special JS feature or syntax used in this benchmark that requires explanation. **Other Considerations:** When testing local storage and session storage performance, it's essential to consider factors like: * Browser version and platform * Device hardware and software capabilities * Network conditions (if applicable) * Storage capacity limits **Alternative Benchmarks:** If you're interested in exploring similar benchmarks, you might want to check out other resources that focus on JavaScript performance testing, such as: * jsbench.net * jsperf.com * benchmarkjs.org These platforms offer a range of benchmarks and test cases that allow you to compare the performance of different JavaScript implementations.
Related benchmarks:
localStorage and sessionStorage Speedtest
LocalStorage/SessionStorage set and remove
Just localStorage vs sessionStorage Speedtest
In-memory, localStorage and sessionStorage Speedtest
Comments
Confirm delete:
Do you really want to delete benchmark?