google / cronet.dart Goto Github PK
View Code? Open in Web Editor NEWThis package binds to Cronet's native API to expose them in Dart.
Home Page: https://pub.dev/packages/cronet
License: BSD 3-Clause "New" or "Revised" License
This package binds to Cronet's native API to expose them in Dart.
Home Page: https://pub.dev/packages/cronet
License: BSD 3-Clause "New" or "Revised" License
While doing benchmarking, we've observed sudden and sorta random dips in performance.
[0712/103533.128980:ERROR:cert_verify_proc_builtin.cc(559)] No net_fetcher for performing AIA chasing.
Cronet(Throughput): Total Spawned: 8, Returned in time: 8.
[0712/103533.583837:ERROR:cert_verify_proc_builtin.cc(559)] No net_fetcher for performing AIA chasing.
Cronet(Throughput): Total Spawned: 16, Returned in time: 16.
[0712/103534.120373:ERROR:cert_verify_proc_builtin.cc(559)] No net_fetcher for performing AIA chasing.
Cronet(Throughput): Total Spawned: 32, Returned in time: 30.
[0712/103548.869642:ERROR:cert_verify_proc_builtin.cc(559)] No net_fetcher for performing AIA chasing.
Cronet(Throughput): Total Spawned: 64, Returned in time: 64.
[0712/103549.496886:ERROR:cert_verify_proc_builtin.cc(559)] No net_fetcher for performing AIA chasing.
Cronet(Throughput): Total Spawned: 128, Returned in time: 121.
[0712/103557.274973:ERROR:cert_verify_proc_builtin.cc(559)] No net_fetcher for performing AIA chasing.
Cronet(Throughput): Total Spawned: 256, Returned in time: 256.
See dips in 32
and 128
marks. Errors are due to #10 . This issue may affect reports in #3 .
We should get an understanding of how package:cronet
stacks up against dart:io
. Cronet is not integrated into the Dart VM which might create some overhead. On the other hand Cronet provides HTTP 2 and QUIC.
We should add a benchmarks/
folder. Some inspiration from setting up benchmarks can be done from https://github.com/dart-lang/sdk/blob/master/benchmarks/MapLookup/dart/MapLookup.dart.
We are interested in multiple dimensions:
dart ...
) and AOT (dart compile exe ...
).HttpHeaders
class also gives us some handy methods to mutate some commonly used headers (such as contentLength
, persistentConnection
etc.) besides the set
method.
set
method can be used to add any headers, including but not limited to the above mentioned ones. set
method is being implemented via #26 and tracked using #25.
This issue is a superset/improvement of #25.
Use android studio to compile Unknown CMake command "add_compile_definitions", the current cmke is version 3.18+
We should add Flutter support (Flutter Desktop x3 and mobile x2).
flutter pub run cronet:setup failed with error
Unhandled exception:
Invalid argument(s): Failed to lookup symbol 'VersionString': error code 127
#0 DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:34:70)
#1 Wrapper._VersionString_ptr (package:cronet/src/wrapper/generated_bindings.dart:34:52)
#2 Wrapper._VersionString_ptr (package:cronet/src/wrapper/generated_bindings.dart)
#3 Wrapper._VersionString (package:cronet/src/wrapper/generated_bindings.dart:36:7)
#4 Wrapper._VersionString (package:cronet/src/wrapper/generated_bindings.dart)
#5 Wrapper.VersionString (package:cronet/src/wrapper/generated_bindings.dart:30:12)
#6 downloadCronetBinaries (file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/cronet-0.0.7/bin/setup.dart:99:32)
#7 main (file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/cronet-0.0.7/bin/setup.dart:280:13)
#8 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:295:32)
#9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
pub finished with exit code 255
[√] Flutter (Channel stable, 3.3.9, on Microsoft Windows [Version 10.0.22621.900], locale ja-JP)
• Flutter version 3.3.9 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b8f7f1f986 (3 weeks ago), 2022-11-23 06:43:51 +0900
• Engine revision 8f2221fbef
• Dart version 2.18.5
• DevTools version 2.15.0
Adding support for user added headers while performing a request. Most common use case for this feature is setting content-type
header while sending some data through POST
request.
Currently only 64bit systems (Android and Desktops) are compatible with this package. Support for 32 bit systems are required for older devices and Android Emulators.
Modify Throughput Benchmark such that the no. of parallel request is always constant.
Results:
Latency Test Results
Mode | package:cronet | dart:io |
---|---|---|
JIT | 241.556 ms | 416.000 ms |
AOT | 246.111 ms | 368.333 ms |
Throughput Test Results (Duration: 1s)
Mode | package:cronet | dart:io |
---|---|---|
JIT | 140 (Parallel Requests: 1024) | 28 (Parallel Requests: 64) |
AOT | 162 (Parallel Requests: 128) | 28 (Parallel Requests: 64) |
When I use 32-bit dynamic library, whether it is http or quic, the following error occurs:
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid argument(s): Count must be in the range [0, 1073741823].
#0 _asExternalTypedData (dart:ffi-patch/ffi_patch.dart:45)
#1 Uint8Pointer.asTypedList (dart:ffi-patch/ffi_patch.dart:432)
#2 CallbackHandler.listen. (package:cronet/src/http_callback_handler.dart:170)
#3 _rootRunUnary (dart:async/zone.dart:1444)
#4 _CustomZone.runUnary (dart:async/zone.dart:1335)
#5 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244)
#6 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341)
#7 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271)
#8 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733)
#9 _StreamController._add (dart:async/stream_controller.dart:607)
#10 _StreamController.add (dart:async/stream_controller.dart:554)
#11 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184)
Hi,
thank you for this library!
I was wondering if support for the Webtransport protocol is planned.
It seems Webtransport is supported by Cronet (as its js APIs are available in Chromium/Chrome since version 97).
Support for the Webtransport protocol would be huge in enabling Flutter developers to develop faster real-time apps and games.
On Android, Cronet is available as a Java API.
We would save binary size for Flutter apps if we could access the underlying Cronet dynamic library shipped on Android and bind to that, instead of shipping our own Cronet dynamic library.
Cronet enables us to specify storage type to store cookies and cache requests to speed up network request even more.
TODO: Add options to specify storage type (i.e. in disk, in memory) including their size or disabling any kind of storage.
Any idea why cronet is using TCP even though I've defined to use quic in HttpClient constructor?
Tested on Windows 10 Home 21h1
The files in bin/ tool/ and benchmarks/ (after #8) could use package:args for a more structured approach to command line arguments.
i have clone this repo and following instruction on readme,
and when I running the example app I have some issue like this
so I try to comment that line,
it is worked, and I have not issue if I running on debug mode, but if I run flutter run --release
or flutter build apk
application always force close on emulator or real device
if i miss something, can you tell me please?
This issue was automatically created by Allstar.
Security Policy Violation
Project is out of compliance with Binary Artifacts policy: binaries present in source code
Rule Description
Binary Artifacts are an increased security risk in your repository. Binary artifacts cannot be reviewed, allowing the introduction of possibly obsolete or maliciously subverted executables. For more information see the Security Scorecards Documentation for Binary Artifacts.
Remediation Steps
To remediate, remove the generated executable artifacts from the repository.
Artifacts Found
Additional Information
This policy is drawn from Security Scorecards, which is a tool that scores a project's adherence to security best practices. You may wish to run a Scorecards scan directly on this repository for more details.
Allstar has been installed on all Google managed GitHub orgs. Policies are gradually being rolled out and enforced by the GOSST and OSPO teams. Learn more at http://go/allstar
This issue will auto resolve when the policy is in compliance.
Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.
When we try to establish any HTTPS
connection, we see this error at the very beginning of the request -
[0713/084505.884443:ERROR:cert_verify_proc_builtin.cc(559)] No net_fetcher for performing AIA chasing.
We may encounter this multiple times in case of redirects but strictly in case of TLS connections.
This also affects: https://chromium.googlesource.com/chromium/src/+/475fd34f798f69ae3fb52b117355fa6195adde28/components/cronet/native/sample/
Data is fetched with accuracy despite of this error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.