-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.dart2js-optimizationtype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)web-dart2js
Description
According to http://stackoverflow.com/questions/28359949/how-to-convert-binary-data-to-utf8-string-after-dart2js utf8 encoding/decoding is slow in dart2js.
Load:
import 'dart:convert';
import 'package:archive/archive.dart';
import 'package:crypto/crypto.dart';
var base64 = CryptoUtils.base64StringToBytes(window.localStorage[storageName]);
var decompress = new GZipDecoder().decodeBytes(base64);
storage = JSON.decode(new Utf8Decoder().convert(decompress));
Save:
var g = JSON.encode(storage);
List<int> bz2 = new GZipEncoder().encode(new Utf8Encoder().convert(g));
window.localStorage[storageName] = CryptoUtils.bytesToBase64(bz2);
Metadata
Metadata
Assignees
Labels
area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.dart2js-optimizationtype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)web-dart2js