Great series of short articles introducing Apple's Metal framework.
- 2022-04-01: Day 1: Devices
- 2022-04-02: Day 2: Buffers
- 2022-04-03: Day 3: Commands
- 2022-04-04: Day 4: MTKView
- 2022-04-05: Day 5: Shaders
- 2022-04-06: Day 6: Pipelines
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
HStack { | |
Text("Hello") | |
.padding() | |
.background(.blue) | |
.overlay { | |
Color.yellow |
Great series of short articles introducing Apple's Metal framework.
-module(bench). % -*- erlang -*-; | |
-mode(compile). | |
%% Based on the benchmark in https://github.com/erlang/otp/issues/5639. | |
main([]) -> | |
Data100B = crypto:strong_rand_bytes(100), | |
Data1MB = crypto:strong_rand_bytes(1024 * 1024), | |
io:format("== Testing with 100 B ==~n"), | |
test_encode(Data100B, 1_000_000), |
-module(pt_benchmark). | |
-compile([export_all,nowarn_export_all]). | |
b() -> | |
%% run(fun pt_imm/1, fun pdict_imm/1), | |
%% run(fun pt/1, fun pdict/1), | |
%% run(fun pt_striped/1, fun pdict_striped/1), | |
%% run(fun pt_record/1, fun pdict_record/1), | |
run(fun ets_imm/1, fun pt_imm/1), | |
run(fun ets/1, fun pt/1), |
Demonstrating the bug. | |
Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] | |
Eshell V10.0 (abort with ^G) | |
1> c(hipe_bug, [from_asm,native]). | |
{ok,hipe_bug} | |
2> hipe_bug:run(). | |
size_object: matchstate term not allowedAborted (core dumped) |
-module(same_line). | |
-export([core_transform/2]). | |
%% | |
%% erlc -pa . '+{core_transform,same_line}' <filename>.erl | |
%% | |
core_transform(Core, _Options) -> | |
F = fun(Node) -> | |
case cerl:get_ann(Node) of |
Demonstrating the bug. | |
The hipe_bug.S file was generated using the new SSA-based compiler. | |
Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] | |
Eshell V10.0 (abort with ^G) | |
1> c(hipe_bug, [from_asm,native]), hipe_bug:run(). | |
** exception error: {badmap,{cons,{arg,0},nil}} | |
in function hipe_bug:dig_out_fc/1 |
#!/usr/bin/perl -w | |
use strict; | |
# Analyse beam_emu.s and try to find out the registers | |
# used for the important variables in process_main(). | |
# | |
# Works for .s files from clang or gcc. For gcc, the -fverbose-asm | |
# option must be used. | |
# | |
# Example: |
#!/bin/sh | |
git clean -dxfq | |
./otp_build autoconf | |
./configure | |
# Build the minimum number of applications. | |
OTP_SMALL_BUILD=true | |
export OTP_SMALL_BUILD | |
for app in asn1 hipe ic inets jinterface snmp; do | |
echo "Build faster" >lib/$app/SKIP |