whistle whistle
Tags Archives Links
  • 开始使用
  • Tags
  • Archives
  • Links
  • Search
  • RSS
当golang程序在运行过程中消耗了超出预期内存时,需要搞明白,到底是程序中哪些代码导致了这些内存消耗。此时,通常可以采用golang的pprof来分析golang进程的内存使用。
置顶!

golang 内存分析/内存泄漏

golang
gctrace主要是用于跟踪GC的不同阶段的耗时与GC前后的内存量对比。可以用于对runtime本身进行调试之外,还可以观察线上应用的GC情况。
置顶!

golang gctrace分析gc过程

golang
共享变量的拷贝和append操作线程不安全,导致map被多个协程操作,引发panic。
置顶!

Slice - append操作引发的panic

golang
wrk 是一款简单的 HTTP 压测工具。
置顶!

性能测试工具——wrk

http
给定一个非负整数数组nums和一个整数m ,你需要将这个数组分成m个非空的连续子数组。 设计一个算法使得这m个子数组各自和的最大值最小。

410. 分割数组的最大值

dp
给你一个由若干括号和字母组成的字符串 s ,删除最小数量的无效括号,使得输入的字符串有效。 返回所有可能的结果。答案可以按任意顺序返回。

301. 删除无效的括号

leetcode
Given an m x n grid of characters board and a string word, return true if word exists in the grid.

79. 单词搜索

leetcode
通过先序和中序数组生成后序数组

通过先序和中序数组生成后序数组

tree
A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null.Construct a deep copy of the list.

138. Copy List with Random Pointer

leetcode
Given two strings text1 and text2, return common subsequence. If there is no common subsequence, return 0.

1143. Longest Common Subsequence

dp
You want to schedule a list of jobs in d days. Jobs are dependent (i.e To work on the i-th job, you have to finish all the jobs j where 0 <= j < i).

1335. Minimum Difficulty of a Job Schedule

leetcode
Given an m x n matrix. If an element is 0, set its entire row and column to 0. Do it in-place.

73. Set Matrix Zeroes

leetcode
给定一个链表,其中奇数位是升序的,偶数位是降序的,实现链表的排序。

重排奇偶有序链表

leetcode
最近处理的单据业务经常会因为接口不幂等导致数据出错的情况。所以幂等性在设计系统的时候一定要考虑进去,尤其是像支付宝、银行、互联网金融公司等涉及的都是钱的系统,既要高效,也要准确,所以不能出现多扣款、多打款等问题,不然这样会很难处理,用户体验也不会好。

接口实现幂等的几种方式

系统设计
Return True if the path crosses itself at any point, that is, if at any time you are on a location you've previously visited. Return False otherwise.

1496. Path Crossing

leetcode
Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.

680. Valid Palindrome II

leetcode
golang官方库中有一个rate包,实现了令牌桶算法。

golang 标准库 time/rate 介绍

golang
令牌桶:初始化一定数量的令牌,每个请求都需要先到桶里获取令牌才能获得服务,如果桶中的令牌数量为零,则拒绝服务,丢弃请求。

常见的限流算法

mics
正则表达式(regular expression)描述了一种字符串匹配的模式(pattern),可以用来检查一个串是否含有某种子串、将匹配的子串替换或者从某个串中取出符合某个条件的子串等。

正则表达式

utility
Golang的版本管理视频推荐:Go with Versions - GopherConSG 2018

Go modules 简介

golang
1 2 3 4 5 6 7 8 9 10 11 12
RSS 开始使用
michael - Nothing just happens, it's all part of a plan.

Open Source, Open Mind,
Open Sight, Open Future!
224 文章
181274 浏览     2 当前访客
© 2022 whistle 粤ICP备19064901号-1