kong 网关和spring cloud gateway网关性能测试对比

在这里插入图片描述

该测试只是简单在同一台机器设备对spring cloud gateway网关和kong网关进行对比,受限于笔者所拥有的资源,此处仅做简单评测。

一、使用spring boot 的auth-service作为服务提供者

该服务提供了一个/health接口,接口返回"OK",运行的地址为:192.168.188.108:8174

二、使用kong 网关代理该服务
2.1、创建service
curl -i -s -X POST http://localhost:8001/services   --data name=auth-service   --data url='http://192.168.188.108:8174'
2.2. 给服务绑定route
curl -i -X POST http://localhost:8001/services/auth-service/routes   --data 'paths[]=/auth-service'  --data name=auth-service_route
2.3、测试通过kong网关来进行访问
[root@localhost ~]# curl -X GET http://192.168.188.101:8000/auth-service/health
ok
2.4、使用upstream来进行负载均衡
  • 创建upstream
curl -X POST http://localhost:8001/upstreams --data name=auth_upstream
  • 给upstream绑定目标服务
curl -X POST http://localhost:8001/upstreams/auth_upstream/targets --data target='192.168.188.108:8174'
curl -X POST http://localhost:8001/upstreams/auth_upstream/targets --data target='192.168.188.108:8176'
  • 更新service指定的url地址
curl -X PATCH http://localhost:8001/services/auth-service --data host='auth_upstream'
三、搭建spring cloud 的gateway网关环境
<?xml version="1.0" encoding="UTF-8"?>
<!--suppress MavenPropertyInParent -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>api-module-gateways</artifactId>
        <groupId>com.api</groupId>
        <version>${env.project.version}</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>manager-gateway</artifactId>
    <packaging>jar</packaging>
    <description>后台管理网关</description>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>


    <!-- 具体的jar包依赖 -->
    <dependencies>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-gateway</artifactId>
        </dependency>

        <!-- 注册中心与配置中心 -->
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
        </dependency>

        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
        </dependency>


        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-openfeign-core</artifactId>
        </dependency>

        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-okhttp</artifactId>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>



    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.1.0.RELEASE</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

bootstrap.yaml

server:
   port: 8171
spring:
  cloud:
    gateway:
      discovery:
        locator:
          enabled: true 
      routes:
        - id: auth-service
          uri: lb://auth-service
          predicates:
            - Path=/auth-service/**
          filters:
            - RewritePath=/auth-service/(?<path>.*), /$\{path}
feign:
  client:
    config:
      default:
        connectTimeout: 10000
        readTimeout: 10000 
open:
  gateway:
    excludes: 
      skipUrl:
        - /config/all/content
        - /auth/manager/captcha
        - /auth/manager/login
        - /auth/manager/isAlreadylogin
        - /config/dick/selectAllDick
        - /config/menu/selectTreeDick
        - /health

测试接口能否正常使用:

curl -X GET http://192.168.188.108:8171/auth-service/health
四、性能测试对比
4.1、1000个请求、100并发场景
  • kong 网关

    [root@localhost wrk-4.2.0]# ab -n 1000 -c 100 http://192.168.188.101:8000/auth-service/health
    This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/
    
    Benchmarking 192.168.188.101 (be patient)
    Completed 100 requests
    Completed 200 requests
    Completed 300 requests
    Completed 400 requests
    Completed 500 requests
    Completed 600 requests
    Completed 700 requests
    Completed 800 requests
    Completed 900 requests
    Completed 1000 requests
    Finished 1000 requests
    
    
    Server Software:        kong/3.9.0.0-enterprise-edition
    Server Hostname:        192.168.188.101
    Server Port:            8000
    
    Document Path:          /auth-service/health
    Document Length:        2 bytes
    
    Concurrency Level:      100
    Time taken for tests:   0.321 seconds
    Complete requests:      1000
    Failed requests:        0
    Write errors:           0
    Total transferred:      325331 bytes
    HTML transferred:       2000 bytes
    Requests per second:    3112.66 [#/sec] (mean)
    Time per request:       32.127 [ms] (mean)
    Time per request:       0.321 [ms] (mean, across all concurrent requests)
    Transfer rate:          988.91 [Kbytes/sec] received
    
    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:        1    8   3.9      8      17
    Processing:     3   21   9.9     18      67
    Waiting:        3   19   9.3     15      62
    Total:         10   29  10.8     28      79
    
    Percentage of the requests served within a certain time (ms)
      50%     28
      66%     30
      75%     33
      80%     36
      90%     44
      95%     48
      98%     62
      99%     70
     100%     79 (longest request)
    
  • spring cloud gateway

[root@localhost wrk-4.2.0]# ab -n 1000 -c 100 http://192.168.188.108:8171/auth-service/health
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.188.108 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:
Server Hostname:        192.168.188.108
Server Port:            8171

Document Path:          /auth-service/health
Document Length:        2 bytes

Concurrency Level:      100
Time taken for tests:   0.676 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      182000 bytes
HTML transferred:       2000 bytes
Requests per second:    1478.79 [#/sec] (mean)
Time per request:       67.623 [ms] (mean)
Time per request:       0.676 [ms] (mean, across all concurrent requests)
Transfer rate:          262.83 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    9   7.2      7      32
Processing:    13   55  19.6     50     108
Waiting:       12   53  18.5     50     104
Total:         24   63  18.4     57     113

Percentage of the requests served within a certain time (ms)
  50%     57
  66%     69
  75%     78
  80%     82
  90%     90
  95%     98
  98%    105
  99%    111
 100%    113 (longest request)
4.2、10000个请求、100并发场景
  • kong网关

    [root@localhost wrk-4.2.0]# ab -n 10000 -c 100 http://192.168.188.101:8000/auth-service/health
    This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/
    
    Benchmarking 192.168.188.101 (be patient)
    Completed 1000 requests
    Completed 2000 requests
    Completed 3000 requests
    Completed 4000 requests
    Completed 5000 requests
    Completed 6000 requests
    Completed 7000 requests
    Completed 8000 requests
    Completed 9000 requests
    Completed 10000 requests
    Finished 10000 requests
    
    
    Server Software:        kong/3.9.0.0-enterprise-edition
    Server Hostname:        192.168.188.101
    Server Port:            8000
    
    Document Path:          /auth-service/health
    Document Length:        2 bytes
    
    Concurrency Level:      100
    Time taken for tests:   1.549 seconds
    Complete requests:      10000
    Failed requests:        0
    Write errors:           0
    Total transferred:      3250520 bytes
    HTML transferred:       20000 bytes
    Requests per second:    6455.87 [#/sec] (mean)
    Time per request:       15.490 [ms] (mean)
    Time per request:       0.155 [ms] (mean, across all concurrent requests)
    Transfer rate:          2049.31 [Kbytes/sec] received
    
    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:        1    5   2.0      5      13
    Processing:     2   10   4.4     10      44
    Waiting:        2   10   4.0      9      42
    Total:          4   15   5.0     14      49
    
    Percentage of the requests served within a certain time (ms)
      50%     14
      66%     16
      75%     18
      80%     19
      90%     23
      95%     25
      98%     28
      99%     31
     100%     49 (longest request)
    
  • spring cloud gateway

[root@localhost wrk-4.2.0]# ab -n 10000 -c 100 http://192.168.188.108:8171/auth-service/health
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.188.108 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:
Server Hostname:        192.168.188.108
Server Port:            8171

Document Path:          /auth-service/health
Document Length:        2 bytes

Concurrency Level:      100
Time taken for tests:   4.399 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      1820000 bytes
HTML transferred:       20000 bytes
Requests per second:    2273.37 [#/sec] (mean)
Time per request:       43.988 [ms] (mean)
Time per request:       0.440 [ms] (mean, across all concurrent requests)
Transfer rate:          404.06 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    4   4.7      2      36
Processing:     6   40   9.5     39      89
Waiting:        6   39   9.7     38      89
Total:         13   44   8.7     42      91

Percentage of the requests served within a certain time (ms)
  50%     42
  66%     45
  75%     47
  80%     49
  90%     55
  95%     59
  98%     66
  99%     72
 100%     91 (longest request)
4.3、100000个请求、500并发场景
  • kong网关

    [root@localhost wrk-4.2.0]# ab -n 100000 -c 500 http://192.168.188.101:8000/auth-service/health
    This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/
    
    Benchmarking 192.168.188.101 (be patient)
    Completed 10000 requests
    Completed 20000 requests
    Completed 30000 requests
    Completed 40000 requests
    Completed 50000 requests
    Completed 60000 requests
    Completed 70000 requests
    Completed 80000 requests
    Completed 90000 requests
    Completed 100000 requests
    Finished 100000 requests
    
    
    Server Software:        kong/3.9.0.0-enterprise-edition
    Server Hostname:        192.168.188.101
    Server Port:            8000
    
    Document Path:          /auth-service/health
    Document Length:        2 bytes
    
    Concurrency Level:      500
    Time taken for tests:   14.316 seconds
    Complete requests:      100000
    Failed requests:        0
    Write errors:           0
    Total transferred:      32598168 bytes
    HTML transferred:       200000 bytes
    Requests per second:    6985.06 [#/sec] (mean)
    Time per request:       71.581 [ms] (mean)
    Time per request:       0.143 [ms] (mean, across all concurrent requests)
    Transfer rate:          2223.64 [Kbytes/sec] received
    
    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:        0   33  64.3     29    3032
    Processing:    13   38  18.7     35     353
    Waiting:        3   37  18.5     35     352
    Total:         23   70  67.0     65    3067
    
    Percentage of the requests served within a certain time (ms)
      50%     65
      66%     67
      75%     69
      80%     71
      90%     75
      95%     81
      98%     93
      99%    120
     100%   3067 (longest request)
    
  • spring cloud gateway

[root@localhost wrk-4.2.0]# ab -n 100000 -c 500 http://192.168.188.108:8171/auth-service/health
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.188.108 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests


Server Software:
Server Hostname:        192.168.188.108
Server Port:            8171

Document Path:          /auth-service/health
Document Length:        2 bytes

Concurrency Level:      500
Time taken for tests:   41.851 seconds
Complete requests:      100000
Failed requests:        0
Write errors:           0
Total transferred:      18200000 bytes
HTML transferred:       200000 bytes
Requests per second:    2389.42 [#/sec] (mean)
Time per request:       209.256 [ms] (mean)
Time per request:       0.419 [ms] (mean, across all concurrent requests)
Transfer rate:          424.68 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  130 711.8      2   15067
Processing:     7   73  13.3     71     285
Waiting:        6   73  13.0     70     234
Total:         19  203 712.8     74   15156

Percentage of the requests served within a certain time (ms)
  50%     74
  66%     77
  75%     81
  80%     84
  90%    104
  95%   1078
  98%   3072
  99%   3093
 100%  15156 (longest request)
kong网关与Spring cloud网关的性能对比
测试场景指标Kong 网关Spring Cloud Gateway
十万 请求, 10并发请求完成时间 (秒)37.81553.754
每秒请求数 (#/sec)2644.481860.34
平均每个请求时间 (ms)3.7815.375
传输速率 (Kbytes/sec)839.31330.65
50% 响应时间 (ms)35
95% 响应时间 (ms)87
最大响应时间 (ms)2083
十万 请求, 50并发请求完成时间 (秒)17.01839.327
每秒请求数 (#/sec)5876.282542.79
平均每个请求时间 (ms)8.50919.663
传输速率 (Kbytes/sec)1865.07451.94
50% 响应时间 (ms)819
95% 响应时间 (ms)1326
最大响应时间 (ms)59162
十万 请求, 100 并发请求完成时间 (秒)15.57339.906
每秒请求数 (#/sec)6421.282505.89
平均每个请求时间 (ms)15.57339.906
传输速率 (Kbytes/sec)2031.99445.38
50% 响应时间 (ms)1538
95% 响应时间 (ms)2555
最大响应时间 (ms)76183
十万 请求, 200 并发请求完成时间 (秒)14.86141.003
每秒请求数 (#/sec)6729.092438.82
平均每个请求时间 (ms)29.72282.007
传输速率 (Kbytes/sec)2049.31433.46
50% 响应时间 (ms)2979
95% 响应时间 (ms)4298
最大响应时间 (ms)120212
十万 请求, 500 并发请求完成时间 (秒)15.05443.48
每秒请求数 (#/sec)6642.812299.91
平均每个请求时间 (ms)75.269217.4
传输速率 (Kbytes/sec)2108.14408.77
50% 响应时间 (ms)6881
95% 响应时间 (ms)961091
最大响应时间 (ms)111115144
Kong 网关在高并发情况下整体性能优于 Spring Cloud Gateway,主要体现在更快的响应时间、更高的每秒请求数以及较低的延迟波动。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/958002.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

winfrom项目,引用EPPlus.dll实现将DataTable 中的数据保存到Excel文件

最近研究不安装office也可以保存Excel文件&#xff0c;在网上查询资料找到这个方法。 第一步&#xff1a;下载EPPlus.dll文件&#xff08;自行去网上搜索下载&#xff09; 第二步&#xff1a;引用到需要用的项目中&#xff0c;如图所示&#xff1a; 第三步&#xff1a;写代码…

框架层实现cpu高负载(cpuload)的检测方案

摘要 这是2018年在小厂的老方案了&#xff0c;现在看方案已经过时了也不太合理&#xff0c;仅供参考&#xff0c;上层框架开启一个5分钟定时器&#xff0c;检测5分钟内总cpu负载和每个线程cpu负载情况&#xff0c;当检测到cpu负载大于绿盟性能或功耗定义的阈值时&#xff0c;结…

Android BitmapShader简洁实现马赛克,Kotlin(一)

Android BitmapShader简洁实现马赛克&#xff0c;Kotlin&#xff08;一&#xff09; 这一篇&#xff0c; Android使用PorterDuffXfermode模式PorterDuff.Mode.SRC_OUT橡皮擦实现马赛克效果&#xff0c;Kotlin&#xff08;3&#xff09;-CSDN博客 基于PorterDuffXfermode实现马…

人工智能在数字化转型中的角色:从数据分析到智能决策

引言 在数字化转型浪潮中&#xff0c;人工智能&#xff08;AI&#xff09;正迅速崛起&#xff0c;成为推动企业创新和变革的关键力量。面对日益复杂的市场环境和激烈的行业竞争&#xff0c;企业亟需借助技术手段提高运营效率、优化决策过程&#xff0c;并增强市场竞争力。而AI…

「全网最细 + 实战源码案例」设计模式——工厂方法模式

核心思想 简单工厂模式是一种创建者模式&#xff0c;它通过一个工厂类负责创建不同类型的对象&#xff0c;根据传入的参数决定实例化的具体类&#xff0c;也被称为“静态工厂方法”模式&#xff0c;因为工厂方法通常是静态的。 结构 1. 工厂类&#xff1a; 提供一个静态方法…

我的图形布局 组织结构图布局

组织结构图布局,有的人也叫它树状布局,在图形中是经常用到的布局算法.形成类似如下图的图形布局方式 首先创建一个类, public class TreeLayouter {private int m_space 40;/// <summary>/// 空间间隔/// </summary>public int Space{get { return m_space; }se…

Golang:使用DuckDB查询Parquet文件数据

本文介绍DuckDB查询Parquet文件的典型应用场景&#xff0c;掌握DuckDB会让你的产品分析能力更强&#xff0c;相反系统运营成本相对较低。为了示例完整&#xff0c;我也提供了如何使用Python导出MongoDB数据。 Apache Parquet文件格式在存储和传输大型数据集方面变得非常流行。最…

Rust Actix Web 项目实战教程 mysql redis swagger:构建用户管理系统

Rust Actix Web 项目实战教程&#xff1a;构建用户管理系统 项目概述 本教程将指导你使用 Rust 和 Actix Web 构建一个完整的用户管理系统&#xff0c;包括数据库交互、Redis 缓存和 Swagger UI 文档。 技术栈 Rust 编程语言Actix Web 框架SQLx (MySQL 数据库)Redis 缓存Uto…

校园网上店铺的设计与实现(代码+数据库+LW)

摘 要 如今社会上各行各业&#xff0c;都喜欢用自己行业的专属软件工作&#xff0c;互联网发展到这个时候&#xff0c;人们已经发现离不开了互联网。新技术的产生&#xff0c;往往能解决一些老技术的弊端问题。因为传统校园店铺商品销售信息管理难度大&#xff0c;容错率低&a…

生成对抗网络(GAN)入门与编程实现

生成对抗网络&#xff08;Generative Adversarial Networks, 简称 GAN&#xff09;自 2014 年由 Ian Goodfellow 等人提出以来&#xff0c;迅速成为机器学习和深度学习领域的重要工具之一。GAN 以其在图像生成、风格转换、数据增强等领域的出色表现&#xff0c;吸引了广泛的研究…

26、正则表达式

目录 一. 匹配字符 .&#xff1a;匹配除换行符外的任意单个字符。 二. 位置锚点 ^&#xff1a;匹配输入字符串的开始位置。 $&#xff1a;匹配输入字符串的结束位置。 \b&#xff1a;匹配单词边界。 \B&#xff1a;匹配非单词边界。 三. 重复限定符 *&#xff1a;匹配…

电子应用设计方案101:智能家庭AI喝水杯系统设计

智能家庭 AI 喝水杯系统设计 一、引言 智能家庭 AI 喝水杯系统旨在为用户提供个性化的饮水提醒和健康管理服务&#xff0c;帮助用户养成良好的饮水习惯。 二、系统概述 1. 系统目标 - 精确监测饮水量和饮水频率。 - 根据用户的身体状况和活动量&#xff0c;智能制定饮水计划。…

数据表中的数据查询

文章目录 一、概述二、简单查询1.列出表中所有字段2.“*”符号表示所有字段3.查询指定字段数据4.DISTINCT查询 三、IN查询四、BETWEEN ADN查询1.符合范围的数据记录查询2.不符合范围的数据记录查询 五、LIKE模糊查询六、对查询结果排序七、简单分组查询1.统计数量2.统计计算平均…

【HarmonyOS NAPI 深度探索12】创建你的第一个 HarmonyOS NAPI 模块

【HarmonyOS NAPI 深度探索12】创建你的第一个 HarmonyOS NAPI 模块 在本篇文章中&#xff0c;我们将一步步走过如何创建一个简单的 HarmonyOS NAPI 模块。通过这个模块&#xff0c;你将能够更好地理解 NAPI 的工作原理&#xff0c;并在你的应用中开始使用 C 与 JavaScript 的…

步入响应式编程篇(二)之Reactor API

步入响应式编程篇&#xff08;二&#xff09;之Reactor API 前言回顾响应式编程Reactor API的使用Stream引入依赖Reactor API的使用流源头的创建 reactor api的背压模式发布者与订阅者使用的线程查看弹珠图查看形成新流的日志 前言 对于响应式编程的基于概念&#xff0c;以及J…

Unity Line Renderer Component入门

Overview Line Renderer 组件是 Unity 中用于绘制连续线段的工具。它通过在三维空间中的两个或两个以上的点的数组&#xff0c;并在每个点之间绘制一条直线。可以绘制从简单的直线到复杂的螺旋线等各种图形。 1. 连续性和独立线条 连续性&#xff1a;Line Renderer 绘制的线条…

使用Chrome和Selenium实现对Superset等私域网站的截图

最近遇到了一个问题&#xff0c;因为一些原因&#xff0c;我搭建的一个 Superset 的 Report 功能由于节假日期间不好控制邮件的发送&#xff0c;所以急需一个方案来替换掉 Superset 的 Report 功能 首先我们需要 Chrome 浏览器和 Chrome Driver&#xff0c;这是执行数据抓取的…

博客搭建 — GitHub Pages 部署

关于 GitHub Pages GitHub Pages 是一项静态站点托管服务&#xff0c;它直接从 GitHub 上的仓库获取 HTML、CSS 和 JavaScript 文件&#xff0c;通过构建过程运行文件&#xff0c;然后发布网站。 本文最终效果是搭建出一个域名为 https://<user>.github.io 的网站 创建…

C++17 新特性解析:Lambda 捕获 this

C17 引入了许多改进和新特性&#xff0c;其中之一是对 lambda 表达式的增强。在这篇文章中&#xff0c;我们将深入探讨 lambda 表达式中的一个特别有用的新特性&#xff1a;通过 *this 捕获当前对象的副本。这个特性不仅提高了代码的安全性&#xff0c;还极大地简化了某些场景下…

Python中采用.add_subplot绘制子图的方法简要举例介绍

Python中采用.add_subplot绘制子图的方法简要举例介绍 目录 Python中采用.add_subplot绘制子图的方法简要举例介绍一、Python中绘制子图的方法1.1 add_subplot函数1.2 基本语法&#xff08;1&#xff09;add_subplot的核心语法&#xff08;2&#xff09;add_subplot在中编程中的…