Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Switch sha512 to use fastpath with wasm #165

Merged
merged 1 commit into from
Mar 21, 2024
Merged

Switch sha512 to use fastpath with wasm #165

merged 1 commit into from
Mar 21, 2024

Conversation

kevmoo
Copy link
Contributor

@kevmoo kevmoo commented Mar 21, 2024

No description provided.

@kevmoo kevmoo requested review from devoncarew and lrhn March 21, 2024 22:46
@@ -7,7 +7,7 @@ import 'dart:convert';
import 'digest.dart';
import 'hash.dart';
// ignore: uri_does_not_exist
import 'sha512_fastsinks.dart' if (dart.library.js) 'sha512_slowsinks.dart';
import 'sha512_fastsinks.dart' if (dart.library.html) 'sha512_slowsinks.dart';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: surprised that the dart.library.js bit was still being chosen by wasm. Asking @srujzs about this now!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dart.library.js exists in libraries.json for dart2wasm. It was used to support allowInterop, but that method has since then moved out of that library, so we should delete it from libraries.json. You can't import it (you get a static error), but it exists.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

("Can't import" should match the value of platform.library.js, "being there" but not being able to import anyway isn't what a conditional import wants to know.)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW - the libraries.json format supports that middleground @lrhn is describing: where you can import a library unconditionally, but the dart.library.xyz returns false on conditional imports. This is true today for dart.library.io on the JS backends, for instance.

So if there is any need to still have a library, but denote it as excluded, we can do so with the same mechanism. (This is what ["supported: false"][1] is for)
[1]: https://github.com/dart-lang/sdk/blob/95cbc6a49724f9aaac6ba72fc69a14e9f9f53d70/sdk/lib/libraries.yaml#L269

That said, as mentioned in https://github.com/dart-lang/crypto/issues/180. I believe this specific case can be addressed for now using the dart.library.ffi condition.

@kevmoo kevmoo merged commit 69d13c9 into master Mar 21, 2024
6 checks passed
@kevmoo kevmoo deleted the wasm_fast_path branch March 21, 2024 22:53
@devoncarew
Copy link
Contributor

Do we want a changelog entry for this (I assume this change will be user visible)? I see the current version at head is a -wip.

@kevmoo
Copy link
Contributor Author

kevmoo commented Mar 22, 2024

It should just be faster. No user visible change at all.

copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Mar 26, 2024
Revisions updated by `dart tools/rev_sdk_deps.dart`.

crypto (https://github.com/dart-lang/crypto/compare/f059196..69d13c9):
  69d13c9  2024-03-21  Kevin Moore  Switch sha512 to use fastpath with wasm (dart-archive/crypto#165)

csslib (https://github.com/dart-lang/csslib/compare/b58e487..4216525):
  4216525  2024-03-21  Devon Carew  prep for publishing 1.0.1 (dart-archive/csslib#197)

dartdoc (https://github.com/dart-lang/dartdoc/compare/7be9e24..79c1675):
  79c16759  2024-03-25  Parker Lougheed  Migrate client code to package:web (dart-lang/dartdoc#3610)
  0b1c7fa4  2024-03-25  dependabot[bot]  Bump actions/cache from 4.0.1 to 4.0.2 (dart-lang/dartdoc#3734)
  9fe35ec5  2024-03-20  Sam Rawlins  mustachio: Separate out the context stack LUB type calculation (dart-lang/dartdoc#3730)

http (https://github.com/dart-lang/http/compare/5dfea72..7949d6f):
  7949d6f  2024-03-25  Brian Quinlan  cupertino_http: upgrade ffigen version (dart-lang/http#1159)
  051482a  2024-03-22  Brian Quinlan  Ready cupertino_http for release with WebSocket support (dart-lang/http#1158)
  988b4d4  2024-03-20  Brian Quinlan  Prepare package:cronet_http 1.2 for release (dart-lang/http#1157)
  69f4eff  2024-03-20  Hossein Yousefi  [cronet_http] Upgrade jni to 0.7.3 (dart-lang/http#1156)
  d8b1a9e  2024-03-19  Brian Quinlan  Release `package:web_socket` 0.1.0 (dart-lang/http#1155)
  cfbc191  2024-03-19  Brian Quinlan  Add a WebSocket implementation to package:cupertino_http (dart-lang/http#1153)

markdown (https://github.com/dart-lang/markdown/compare/9c6b1af..8d07abc):
  8d07abc  2024-03-19  MJ Studio  Link uri encoding, URL-escaping should be left alone inside the destination (dart-lang/markdown#598)

web (https://github.com/dart-lang/web/compare/4af904f..c522718):
  c522718  2024-03-20  Kevin Moore  Update MDN documentation (dart-lang/web#213)
  f80dcab  2024-03-15  Srujan Gaddam  Update pubspec description to be consistent with README (dart-lang/web#210)
  27936c4  2024-03-15  Devon Carew  Generate api docs for getters (dart-lang/web#207)
  2f13cd5  2024-03-12  Devon Carew  fix unresolved dartdoc links (dart-lang/web#200)
  686827a  2024-03-12  Srujan Gaddam  Remove reference to static interop and point to dart.dev page for JS interop (dart-lang/web#206)
  9b7e29d  2024-03-12  Devon Carew  Add a 'sourced from mdn docs' line to the MDN sourced dartdoc (dart-lang/web#198)
  51e594b  2024-03-05  Srujan Gaddam  Fix dictionary constructors to accept supertype members and create an empty object when there are no fields (dart-lang/web#197)

Change-Id: Ic90c6f5a7e7d701746276031a8028cdfe76bc27a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
@h1376h h1376h mentioned this pull request Aug 13, 2024
1 task
kevmoo added a commit that referenced this pull request Aug 14, 2024
Preparing to publish 3.0.5

Revert "Switch sha512 to use fastpath with wasm (#165)"

This reverts commit 69d13c9.
kevmoo added a commit that referenced this pull request Aug 15, 2024
Preparing to publish 3.0.5

Revert "Switch sha512 to use fastpath with wasm (#165)"

This reverts commit 69d13c9.
mosuem pushed a commit to dart-lang/core that referenced this pull request Oct 15, 2024
mosuem pushed a commit to dart-lang/core that referenced this pull request Oct 15, 2024
…rchive/crypto#181)

Preparing to publish 3.0.5

Revert "Switch sha512 to use fastpath with wasm (dart-archive/crypto#165)"

This reverts commit 61dca74.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants