<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>性能测试 :: 标签 :: yafeng 的博客</title>
    <link>https://yafengabc.github.io/tags/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95/index.html</link>
    <description></description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Sat, 19 Sep 2026 16:30:07 +0800</lastBuildDate>
    <atom:link href="https://yafengabc.github.io/tags/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>串口助手极限测试</title>
      <link>https://yafengabc.github.io/cnblogs/p18581812/index.html</link>
      <pubDate>Mon, 02 Dec 2024 14:13:00 +0800</pubDate>
      <guid>https://yafengabc.github.io/cnblogs/p18581812/index.html</guid>
      <description>昨天测试串口助手，发现高速数据流对串口数据压力很大，经测试，压力主要来自windows的组件的接收字串并渲染的速度。&#xA;测试代码如下：&#xA;byte result; while(true) { while(serial.IsOpen &amp;&amp; serial.BytesToRead&gt;=0) { byte_to_read=serial.BytesToRead; result = (byte)serial.ReadByte(); rev_bytes_counter++; rev_frame_counter=rev_bytes_counter/15; } System.Threading.Thread.Sleep(1); } } 现在是15个字节一个帧，结果如下：&#xA;现在接收速率是47KByte/s，3167帧/s，传输速率是427743bps，做到了实时接收，如果加一句显示的代码：&#xA;while(serial.IsOpen &amp;&amp; serial.BytesToRead&gt;=0) { byte_to_read=serial.BytesToRead; result = (byte)serial.ReadByte(); rev_bytes_counter++; textBox1.AppendText(result.ToString(&#34;X2&#34;)+&#34; &#34;); rev_frame_counter=rev_bytes_counter/15; } 速度立刻就炸了，每秒钟只能显示32个帧，然后大量的数据呆在串口缓冲区出不来，最后就boom……&#xA;后来我想，应该就是windows的textbox刷新太慢了，我一次写入大量数据，不就能缓解这个问题了？&#xA;改成如下代码：&#xA;byte[] toview = new byte[256]; while(true) { while(serial.IsOpen &amp;&amp; serial.BytesToRead&gt;=256) { byte_to_read=serial.BytesToRead; serial.Read(toview,0,256); textBox1.AppendText(BitConverter.ToString(toview).Replace(&#34;-&#34;,&#34; &#34;)); rev_bytes_counter+=256; rev_frame_counter=rev_bytes_counter/15; } 也就是一次往textbox里边扔256个字节，测试如下：</description>
    </item>
    <item>
      <title>intel Z8300 2G 32G小主机跟树莓派3B的功耗/性能对比</title>
      <link>https://yafengabc.github.io/cnblogs/p11562232/index.html</link>
      <pubDate>Sat, 21 Sep 2019 11:52:00 +0800</pubDate>
      <guid>https://yafengabc.github.io/cnblogs/p11562232/index.html</guid>
      <description>具体硬件平台就不详细说了，浪费时间码字，贴一个淘宝上的配置：&#xA;有点广告的既视感，哈哈，不过我200块咸鱼收的2手，配置比这个稍低，比如CPU是Z8300，网卡是百兆的，WIFI可能也不是双频的（这个不确定，因为linux下这玩意没驱动起来）不过我买回来不是做NAS，只是想搞个7*24在线的小服务器，映射到外网做一点小服务。所以配置差点也无所谓的样子&#xA;先来个待机功耗图：&#xA;待机2.0瓦。不过这个是算上这个220V/5V 3A的效率的，因为电源的总功率是15W(5V/3A)而目标功率小于3W，所以也算是低负载运行，所以实际功耗应该是小于2瓦的，不像直测USB电流，测出来就是实际功耗，所以在接下来的对比中，我树莓派也用一个5V 3A的充电头来带，尽量做到情景一致&#xA;（不过考虑到不同的充电头，效率也不一样，所以还是不算严谨对比）先来个screenfetch。&#xA;-` .o+` yafeng@archlinux `ooo/ OS: Arch Linux `+oooo: Kernel: x86_64 Linux 5.3.0-arch1-1-ARCH `+oooooo: Uptime: 1h 5m -+oooooo+: Packages: 188 `/:-:++oooo+: Shell: bash 5.0.9 `/++++/+++++++: CPU: Intel Atom x5-Z8300 @ 4x 1.84GHz [40.2°C] `/++++++++++++++: GPU: `/+++ooooooooooooo/` RAM: 88MiB / 1862MiB ./ooosssso++osssssso+` .oossssso-````/ossssss+` -osssssso. :ssssssso. :osssssss/ osssso+++. /ossssssss/ +ssssooo/- `/ossssso+/:- -:/+osssso+- `+sso+:-` `.-/+oso: `++:. `-/+/ .` `/ 算了，不说废话了，先记下现在测试过的结果：</description>
    </item>
    <item>
      <title>Arduino UNO  ESP8266 ESP32 MicroBit IO操作速度对比记录</title>
      <link>https://yafengabc.github.io/cnblogs/p11197001/index.html</link>
      <pubDate>Tue, 16 Jul 2019 19:32:00 +0800</pubDate>
      <guid>https://yafengabc.github.io/cnblogs/p11197001/index.html</guid>
      <description>ESP8266 Arduino C编程&#xA;void setup(){ pinMode(13, OUTPUT); } void loop(){ digitalWrite(13,HIGH); digitalWrite(13,LOW); digitalWrite(13,HIGH); digitalWrite(13,LOW); } 可以看到，相邻的两次digitalWrite之间是958ns(纳秒)，而两次loop之间是6.6us(微秒)，速度还是很快的，而Arduino UNO得到了如下结果：&#xA;可以看到无论是loop内的，还是loop之间的间隔，都是接近的，都在3.25-3.7之间，速度比ESP8266慢几倍的水平（考虑到时序都是在loop内完成）&#xA;下边是同样的代码ESP32得到的结果&#xA;相比ESP8266，还是有很大进步的（综合估计得有10倍）&#xA;下边是Micropython的：&#xA;import machine pin13 = machine.Pin(13, machine.Pin.OUT) while True: pin13.value(1) pin13.value(0) pin13.value(1) pin13.value(0) 先上ESP32的：&#xA;嗯，Arduino水平。&#xA;再看ESP8266：</description>
    </item>
    <item>
      <title>MicroPython入坑记（三）板子上的Python到底有多快？</title>
      <link>https://yafengabc.github.io/cnblogs/p8681713/index.html</link>
      <pubDate>Sat, 31 Mar 2018 12:26:00 +0800</pubDate>
      <guid>https://yafengabc.github.io/cnblogs/p8681713/index.html</guid>
      <description>前几篇都是直接在命令上操作，然而执行py文件才是王道，其实类似nodemcu的lua固件，MicroPython也提供了一个简单的文件系统用来存代码。并自动在开机时执行：&#xA;boot.py&#xA;main,py&#xA;两个文件&#xA;windows用户的话，推荐一个软件：uPyLoader界面如下&#xA;可以看到，左边是本地的文件，右边是ESP8266的文件，两边可以互相传输，也可以删除上边的文件，其他功能自行探索，这个软件自带了一个编辑器，不过很弱。&#xA;还是推荐用vim或者vscode来写代码，然后用这个软件把代码传进去。&#xA;测试代码么，先来个循环：&#xA;import time import micropython def loop1(): t1=t2=0 for i in range(5): t1=time.ticks_us() for i in range(100): pass t2=time.ticks_us() print(t2-t1) time.sleep(2) loop1() 默认工作在80MHZ下，结果是：&#xA;=== with open(&#34;test_loop.py&#34;) as f: === exec(f.read(), globals()) === 4715 4695 4742 4698 4697 &gt;&gt;&gt; 脚本确实不快，100次循环足足用了4.5ms，即使把速度调成160MHZ，也就2.5ms左右也就一次循环25us左右，而ESP32下速度就很赞了：&#xA;paste mode; Ctrl-C to cancel, Ctrl-D to finish === with open(&#34;test_loop.py&#34;) as f: === exec(f.read(), globals()) === 346 262 274 267 278 &gt;&gt;&gt; 10多倍的提速2us-3us循环一次，甚至可以写dht11那样的时序驱动了。esp8266就没办法了吗？当然有!&#xA;MicroPython官方文档上专门有篇代码提速的文章，其中提到了可以用装饰器micropython.native micropython.viper来给代码打鸡血（编译成机器码）&#xA;import time import micropython @micropython.native def loop1(): t1=t2=0 for i in range(5): t1=time.ticks_us() for i in range(100): pass t2=time.ticks_us() print(t2-t1) time.sleep(2) loop1() 加了个@micropython.native装饰器，速度立马鸡血：</description>
    </item>
  </channel>
</rss>