2.4 Go 1.4 runtime
Go 1.4 runtime Gopher China 2015 1. Memory Allocator 2. Garbage Collector 3. Goroutine Scheduler 1. Memory Allocator 内存分配器 base on tcmalloc. 基于成熟方案,性能优秀。随着版本升级, 针对性改进,以期与垃圾回收器更好协作。 核心:自主管理,缓存复用,无锁分配。 阈值触发,并行标记,并发清理。 定期强制回收,释放物理内存。 版本升级,垃圾回收效率总是核心问题。 gogc. 阈值检查,或强制回收。 malloc next_gc 0 gogc runtime.gc() stop start mark sweep stop start mark sweep 0 2 2 1 forcegc 2m 1 mark. 暂停用户逻辑,并行标记。 finalizer span span … cache … stack … G G … mark mark mark markroot scanblock heap.bitmap Go 1.5: concurrent pauseless collector. sweep. 串行,或与用户逻辑并发执行。 gc eagersweep concurrent goroutine0 码力 | 29 页 | 608.57 KB | 1 年前32.1.4 PingCAP Go runtime related problems in TiDB production environment
Go runtime related problems in TiDB production environment About me ● Arthur Mao(毛康力), Senior Engineer@PingCAP ● TiDB core developer (top3 contributor) ● GitBook about golang internals (@tiancaiamao) IO is ready => goroutine wake up == 4.3ms ○ Sometime even 10ms+ latency here! ○ The time spend on runtime schedule is not negligible ● When CPU is overload, which goroutine should be given priority? Analysis longer to be scheduled ● The runtime scheduling does not consider priority ● CPU dense workload could affect IO latency Conclusion Part II - Memory control ● Go Runtime ○ Allocated from OS (mmaped)0 码力 | 56 页 | 50.15 MB | 6 月前3Rust 异步 Runtime 的兼容层 - 施继成
Rust 异步 Runtime 的兼容层 施继成 @ DatenLord Introduce what’s rust async runtime # Rust async runtime Analyze the reason of runtime isolation # Async runtime binding # Compatible layer 1 Create a wheel 2 3 # Rust async runtime 1 Light-weight task • Language and compiler define tasks • How to run it? • When to run it? • How does it deal with the I/O? Rust async runtime Runtime responsibilities it’s multi-thread model Rust async runtime Available Runtimes • Tokio • Async-std • Smol • Monoio Rust async runtime # Async runtime binding 2 Which runtime to choose ? • More adopters • Rich0 码力 | 22 页 | 957.41 KB | 1 年前3Designing an ultra low-overhead multithreading runtime for Nim
Designing an ultra low-overhead multithreading runtime for Nim Mamy Ratsimbazafy mamy@numforge.co Weave https://github.com/mratsim/weave Hello! I am Mamy Ratsimbazafy During the day blockchain/Ethereum multithreading: definitions and use-cases ◇ Parallel APIs ◇ Sources of overhead and runtime design ◇ Minimum viable runtime plan in a weekend 4 Understanding the design space Concurrency vs parallelism hardware threads The same distinctions can be done at a multithreaded language or multithreading runtime level. The problem 8 How to schedule M tasks on N hardware threads? Latency vs Throughput0 码力 | 37 页 | 556.64 KB | 1 年前3Go 入门指南(The way to Go)
第1章:Go 语言的起源,发展与普及 1.1 起源与发展 1.2 语言的主要特性与发展的环境和影响因素 第2章:安装与运行环境 2.1 平台与架构 2.2 Go 环境变量 2.3 在 Linux 上安装 Go 2.4 在 Mac OS X 上安装 Go 2.5 在 Windows 上安装 Go 2.6 安装目录清单 2.7 Go 运行时(runtime) 2.8 Go 解释器 第3章:编辑器、集成开发环境与其它工具 3.1 Go 开发环境的基本要求 3.2 编辑器和集成开发环境 3.3 调试器 3.4 构建并运行 Go 程序 3.5 格式化代码 3.6 生成代码文档 3.7 其它工具 3.8 Go 性能说明 3.9 与其它语言进行交互 第4章:基本结构和基本数据类型 4.1 文件名、关键字与标识符 4.2 Go 程序的基本结构和要素 4.3 常量 4 精密计算和 big 包 9.5 自定义包和可见性 9.6 为自定义包使用 godoc 9.7 使用 go install 安装自定义包 9.8 自定义包的目录结构、go install 和 go test 9.9 通过 Git 打包和安装 9.10 Go 的外部包和项目 9.11 在 Go 程序中使用外部库 第10章:结构(struct)与方法(method) 10.1 结构体定义 100 码力 | 466 页 | 4.44 MB | 1 年前3Go 入门指南(The way to Go)
前言 原文出处:https://github.com/Unknwon/the-way-to-go_ZH_CN 用更少的代码,更短的编译时间,创建运行更快的程序,享受更多 的乐趣 对于学习 Go 编程语言的爱好者来说,这本书无疑是最适合你的一本书籍,这里包含了当前最全面的学习 资源。本书通过对官方的在线文档、名人博客、书籍、相关文章以及演讲的资料收集和整理,并结合我自 身在软件工程、编程语 开发出的软件能够很好地在现代的多核计算机上工作 开发出的软件能够很好地在网络环境下工作 使人们能够享受软件开发的过程 Go 语言就在这样的环境下诞生了,它让人感觉像是 Python 或 Ruby 这样的动态语言,但却又拥有像 C 或者 Java 这类语言的高性能和安全性。 Go 语言出现的目的是希望在编程领域创造最实用的方式来进行软件开发。它并不是要用奇怪的语法和晦 涩难懂的概念来从根本上推翻已有的编程语言,而是建立并改善了 来支持并发和并行编程。 这本书是为那些想要学习 Go 这门全新的,迷人的和充满希望的编程语言的开发者量身定做的。当然,你 在学习 Go 语言之前需要具备一些关于编程的基础知识和经验,并且拥有合适的学习环境,但你并不需要 对 C 或者 Java 或其它类似的语言有非常深入的了解。 对于那些熟悉 C 或者面向对象编程语言的开发者,我们将会在本书中用 Go 和一些编程语言的相关概念进 行比较(书中会使用大家所熟知的缩写0 码力 | 380 页 | 2.97 MB | 1 年前3Go vs. GoPlus(Go+)
Go vs. GoPlus(Go+) 许式伟 x@goplus.org 2021-6-27 北京 话外: 模板 Go 篇 谁是最成功的语言? • 1970 – 至今 -什么语言是最成功的? • C (1970) • C++ (1979) • Objective-C (1986) • Java (1994) • C# (2002) • Go (2009) 2012年8月 C 是 50 至今,>50年,经久不衰 Go, Next C! • Go 语言要学习的是 C,不是 Java -多数的系统级语言包括Java、C#,其根本的编程哲学来源于C++,将 C++的面向对象进一步发扬光大 -但是Go语言的作者们很清楚,C++ 真的没啥好学的,他们要学的是C语 言。C语言经久不衰的根源是它足够简单。Go语言也要足够得简单 • Go,互联网时代的C,下一个C -要再创 C 的辉煌 Go至少领先其他语言10年 年来出现的语言非常之多,各有各的特色,让人眼花 缭乱。但是我个人固执地认为,谈得上突破了 C 语言思想,将编 程理念提高到一个新高度的,仅有 Go 语言而已 • 10 年后才会有语言试图去突破Go语言已经达到的新高度 -不会是现有的任何语言,而会是一门新兴语言 Go,超越我的想象 • Go 语言的各种语法特性显得那么深思熟虑、卓绝不凡,其对软 件架构与工程的理解,让我深觉无法望其项背 • 处处带给我惊喜的语言0 码力 | 54 页 | 1.82 MB | 1 年前3Exporting Go
Exporting Go Robert Griesemer GopherCon Singapore, 2017 Intro ● Go package ○ Namespace ○ Interface (export) ○ Import ● Implementation ○ Export/import (this talk) ○ Linker (not this talk) A long * 3 … 996 == 2^2 * 3 * 83 997 == 997 prime 998 == 2 * 499 999 == 3^3 * 37 1000 == 2^3 * 5^3 Go package main import "fmt" type List struct { Factor, Power int Link *List } func Factor(x lib.o lib.go package client import “./lib” … client.go client.o export data export data go tool compile lib.go go tool compile client.go lib.o before Go 1.7 go object darwin amd64 go1.5 X:none0 码力 | 34 页 | 2.29 MB | 1 年前3The Expressiveness of Go
http://golang.org Monday, October 18, 2010 http://golang.org The Expressiveness of Go Rob Pike JAOO Oct 5, 2010 Monday, October 18, 2010 Who 2 Monday, October 18, 2010 Team 3 Russ Cox Robert source community. Monday, October 18, 2010 Why 4 Why a new language? Monday, October 18, 2010 Why Go? 5 A response to Google’s internal needs: - efficient large scale programming - speed of compilation - complexity, weight, noise (C++, Java) vs. - no static checking (JavaScript, Python) Go is statically typed and compiled, like C++ or Java (with no VM), but in many ways feels as lightweight0 码力 | 49 页 | 839.26 KB | 1 年前3Go Programming
May 21, 2010 Go Programming Russ Cox and Rob Pike May 20, 2010 Friday, May 21, 2010 Live waving 3 View live notes and ask questions about this session on Google Wave: http://bit.ly/go2010io Friday 2010 Go is different 4 Go is more unusual than you might first think. Programming in Go is different from programming in most procedural languages. If you try to write Java* programs in Go, you may may become frustrated. If you write Go programs in Go, you will be much more productive. Our goal today is to teach you to think like a Go programmer. *Sometimes we'll use Java as a reference for0 码力 | 60 页 | 1.04 MB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100