Skip to content

Instantly share code, notes, and snippets.

View jonahwilliams's full-sized avatar

Jonah Williams jonahwilliams

View GitHub Profile
#include <arpa/inet.h>
#include <stdio.h>
int main() {
char * address = "fe80::ec4:7aff:fecc:ea8f%eno0";
char * out;
printf("%d\n", inet_pton(AF_INET6, address, &out));
}
[ ] [ ] Code for optimized function 'package:hello_world/main.dart_SimdMatrix4_invert' {
[ ] [ ] ;; B0
[ ] [ ] ;; B1
[ ] [ ] ;; Enter frame
[ ] [ ] 0x112d968f0 a9bf79fd stp fp, lr, [r15, #-16 ]!
[ ] [ ] 0x112d968f4 aa0f03fd mov fp, r15
[ ] [ ] 0x112d968f8 d10101ef subi r15, r15, 0x40
[ ] [ ] ;; ParallelMove r0 <- S+2
[ ] [ ] 0x112d968fc f9400ba0 ldrx r0, [fp, #16]
[ ] [ ] ;; v3 <- LoadField(v2 . _column0@18166706 {final}) T{_Float32x4}
@jonahwilliams
jonahwilliams / aot_profile_invert
Last active May 7, 2020 05:55
Diagnosing SIMD performance difference
0x2f982516dd0 a9bf79fd stp fp, lr, [r15, #-16 ]!
0x2f982516dd4 aa0f03fd mov fp, r15
0x2f982516dd8 d10101ef subi r15, r15, 0x40
0x2f982516ddc f9400ba0 ldrx r0, [fp, #16]
0x2f982516de0 3cc07000 fldrq v0, [r0, #7]
0x2f982516de4 3cc17001 fldrq v1, [r0, #23]
0x2f982516de8 3cc27002 fldrq v2, [r0, #39]
0x2f982516dec 3cc37003 fldrq v3, [r0, #55]
0x2f982516df0 6e040404 vinss v4[0], v0[0]
0x2f982516df4 6e0c2404 vinss v4[1], v0[1]
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
final entities = <Entity>[];
void main() {
@jonahwilliams
jonahwilliams / main.dart
Last active June 11, 2020 01:25
List allocation benchmark
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/widgets.dart';
List<int> generateWithElement() {
return <int>[
for (int i = 0; i < 1000; i++)
i
@jonahwilliams
jonahwilliams / assembly_example
Last active July 13, 2020 23:14
adding two numbers
Code for optimized function 'package:foobar/main.dart_::_example' {
;; B0
;; B1
;; Enter frame
;; PrologueOffset = 0
0x10841eb50 55 push rbp
0x10841eb51 4889e5 movq rbp,rsp
;; CheckStackOverflow:8(stack=0, loop=0)
0x10841eb54 493b6648 cmpq rsp,[thr+0x48]
0x10841eb58 0f86a7000000 jna 0x000000010841ec05
lib/src/test/test_wrapper.dart: 0.00%
lib/src/tracing.dart: 0.00%
lib/src/fuchsia/amber_ctl.dart: 0.00%
lib/src/android/android_builder.dart: 0.00%
lib/src/commands/analyze_once.dart: 0.00%
lib/src/reporting/disabled_usage.dart: 0.00%
lib/src/macos/application_package.dart: 0.00%
lib/src/base/template.dart: 0.00%
lib/src/build_runner/web_compilation_delegate.dart: 0.00%
lib/src/ios/plist_parser.dart: 0.00%
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_tools/src/base/process.dart';
import 'package:flutter_tools/src/base/terminal.dart';
import 'package:meta/meta.dart';
import 'package:vm_snapshot_analysis/treemap.dart';
import '../base/file_system.dart';
!! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 3.13.1
Flutter extension: 3.13.1 (activated)
App: Visual Studio Code
Version: 1.47.3
Platform: mac
Workspace type: Flutter
lib/src/commands/format.dart: 0.00% | 0 | 28
lib/src/cmake.dart: 0.00% | 0 | 20
lib/src/macos/application_package.dart: 0.00% | 0 | 58
lib/src/test/test_wrapper.dart: 0.00% | 0 | 5
lib/src/test/runner.dart: 0.00% | 0 | 54
lib/src/windows/build_windows.dart: 0.00% | 0 | 79
lib/src/macos/build_macos.dart: 0.00% | 0 | 60
lib/src/linux/build_linux.dart: 0.00% | 0 | 60
lib/src/fuchsia/amber_ctl.dart: 0.00% | 0 | 29
lib/src/commands/analyze.dart: 0.00% | 0 | 48