性能指标解析

核心Web指标

核心Web指标(Core Web Vitals)是Google定义的一组关键性能指标,直接影响用户体验和SEO排名:

  • FCP (First Contentful Paint): 首次内容绘制,记录页面首次渲染任何文本、图像、非白色画布或SVG的时间点

    • 优: < 1.8s | 需改进: 1.8s-3.0s | 差: > 3.0s
  • LCP (Largest Contentful Paint): 最大内容绘制,衡量视口中最大内容元素的渲染时间

    • 优: < 2.5s | 需改进: 2.5s-4.0s | 差: > 4.0s
  • CLS (Cumulative Layout Shift): 累积布局偏移,量化页面加载期间元素意外移动的程度

    • 优: < 0.1 | 需改进: 0.1-0.25 | 差: > 0.25
  • FID (First Input Delay): 首次输入延迟,测量从用户首次交互到浏览器响应的时间

    • 优: < 100ms | 需改进: 100-300ms | 差: > 300ms
  • INP (Interaction to Next Paint): 交互到下一次绘制,测量页面响应用户交互的速度

    • 优: < 200ms | 需改进: 200-500ms | 差: > 500ms
  • TTI (Time to Interactive): 可交互时间,页面完全可交互所需的时间

    • 优: < 3.8s | 需改进: 3.8s-7.3s | 差: > 7.3s
  • TBT (Total Blocking Time): 总阻塞时间,FCP到TTI之间的阻塞主线程时间总和

    • 优: < 200ms | 需改进: 200-600ms | 差: > 600ms

性能评估工具全解析

浏览器开发者工具

Chrome DevTools Performance面板
// 记录性能分析
// 1. 打开DevTools (F12)
// 2. 切换到Performance面板
// 3. 点击"Record"按钮
// 4. 执行要测试的操作
// 5. 点击"Stop"分析结果

关键视图解读:

  • Frames:可视化帧率性能
  • Main:主线程活动,识别长任务和JavaScript执行瓶颈
  • Network:资源加载时序
  • Timings:关键渲染事件标记
Network面板
// 优化资源加载示例
// 预加载关键资源
<link rel="preload" href="critical.css" as="style">
<link rel="preload" href="main.js" as="script">// 预连接到关键域名
<link rel="preconnect" href="https://example.com">
<link rel="dns-prefetch" href="https://api.example.com">// 资源提示优化
document.addEventListener('DOMContentLoaded', () => {// 延迟非关键资源加载const nonCriticalCSS = document.createElement('link');nonCriticalCSS.rel = 'stylesheet';nonCriticalCSS.href = 'non-critical.css';document.head.appendChild(nonCriticalCSS);
});
Memory面板
// 常见内存泄漏示例及修复
// 问题: 事件监听器未移除
function setupEventListeners() {const button = document.getElementById('my-button');button.addEventListener('click', handleClick);// 解决方案: 提供清理函数return function cleanup() {button.removeEventListener('click', handleClick);};
}// 问题: 闭包导致的意外引用
function createDataProcessor(largeData) {return function process() {// 这里使用largeData,导致largeData无法被垃圾回收console.log(largeData.length);};
}// 解决方案: 仅保留必要数据
function createDataProcessor(largeData) {const dataLength = largeData.length; // 仅保留必要信息return function process() {console.log(dataLength);};
}

Lighthouse 深度应用

// 通过编程方式使用Lighthouse
const lighthouse = require('lighthouse');
const chromeLauncher = require('chrome-launcher');async function runLighthouse(url) {const chrome = await chromeLauncher.launch({chromeFlags: ['--headless']});const options = {logLevel: 'info',output: 'html',port: chrome.port,onlyCategories: ['performance', 'accessibility', 'best-practices', 'seo']};const results = await lighthouse(url, options);await chrome.kill();// 分析结果const performanceScore = results.lhr.categories.performance.score * 100;const fcp = results.lhr.audits['first-contentful-paint'].numericValue;const lcp = results.lhr.audits['largest-contentful-paint'].numericValue;const tbt = results.lhr.audits['total-blocking-time'].numericValue;const cls = results.lhr.audits['cumulative-layout-shift'].numericValue;console.log(`Performance Score: ${performanceScore}%`);console.log(`FCP: ${Math.round(fcp)}ms`);console.log(`LCP: ${Math.round(lcp)}ms`);console.log(`TBT: ${Math.round(tbt)}ms`);console.log(`CLS: ${cls}`);return results;
}// 持续集成中应用
runLighthouse('https://example.com').then(results => {if (results.lhr.categories.performance.score < 0.8) {console.error('Performance score below threshold!');process.exit(1);}});

Web Vitals 实战应用

// 使用web-vitals库监控真实用户指标
import {onCLS, onFID, onLCP, onTTFB, onFCP, onINP} from 'web-vitals';function sendToAnalytics({name, delta, id}) {// 构建性能数据有效载荷const payload = {name,value: delta,id,page: window.location.pathname,timestamp: Date.now()};// 发送数据到分析服务navigator.sendBeacon('/analytics', JSON.stringify(payload));
}// 注册监听器
onCLS(sendToAnalytics);
onFID(sendToAnalytics);
onLCP(sendToAnalytics);
onTTFB(sendToAnalytics);
onFCP(sendToAnalytics);
onINP(sendToAnalytics);

第三方监控平台集成

// New Relic 浏览器监控配置
<script type="text/javascript">
window.NREUM||(NREUM={}),__nr_require=function(){/* ...省略初始化代码... */}
// 自定义指标跟踪
function trackCustomMetric(name, value) {if (window.newrelic) {newrelic.setCustomAttribute(name, value);newrelic.noticeError('Performance metric: ' + name);}
}// 监控关键业务流程性能
function measureCheckoutProcess() {const startTime = performance.now();// 完成结账后checkoutButton.addEventListener('click', function() {const endTime = performance.now();const duration = endTime - startTime;trackCustomMetric('checkout_duration', duration);});
}
</script>

实战性能分析与调优流程

性能基线建立与分析

// 创建性能测试环境
const puppeteer = require('puppeteer');
const fs = require('fs');async function capturePerformanceTimeline(url) {const browser = await puppeteer.launch();const page = await browser.newPage();// 启用性能指标收集await page.tracing.start({path: 'trace.json',categories: ['devtools.timeline']});// 启用运行时性能指标await page.evaluateOnNewDocument(() => {window.perfEntries = [];const observer = new PerformanceObserver((list) => {window.perfEntries.push(...list.getEntries());});observer.observe({entryTypes: ['navigation','resource','paint','mark','measure','longtask']});});await page.goto(url, {waitUntil: 'networkidle0'});// 收集性能指标const metrics = await page.evaluate(() => {return {// 页面导航计时navigationTiming: performance.getEntriesByType('navigation')[0],// 绘制指标paintMetrics: performance.getEntriesByType('paint'),// 所有性能条目allEntries: window.perfEntries};});await page.tracing.stop();await browser.close();// 保存收集的指标fs.writeFileSync('performance-metrics.json', JSON.stringify(metrics, null, 2));return metrics;
}capturePerformanceTimeline('https://example.com').then(metrics => console.log('Performance baseline established'));

JavaScript性能优化

// 优化前: 低效的列表渲染
function renderList(items) {const container = document.getElementById('list-container');container.innerHTML = ''; // 导致完全重排重绘items.forEach(item => {container.innerHTML += `<div class="item">${item.name}</div>`;// 每次迭代都修改DOM,触发多次重排});
}// 优化后: 使用DocumentFragment和批量DOM操作
function renderListOptimized(items) {const container = document.getElementById('list-container');const fragment = document.createDocumentFragment();items.forEach(item => {const div = document.createElement('div');div.className = 'item';div.textContent = item.name;fragment.appendChild(div);});// 一次性DOM更新container.innerHTML = '';container.appendChild(fragment);
}// 优化前: 低效事件处理
window.addEventListener('resize', function() {// 每次调整大小都触发昂贵的布局计算updateLayout();
});// 优化后: 使用节流限制事件触发频率
function throttle(func, limit) {let inThrottle;return function() {const args = arguments;const context = this;if (!inThrottle) {func.apply(context, args);inThrottle = true;setTimeout(() => inThrottle = false, limit);}};
}window.addEventListener('resize', throttle(function() {updateLayout();
}, 100));

图像优化与延迟加载

<!-- 图片优化与响应式加载 -->
<picture><source media="(max-width: 768px)" srcset="small.webp 768w" type="image/webp"><source media="(min-width: 769px)" srcset="large.webp 1440w" type="image/webp"><source media="(max-width: 768px)" srcset="small.jpg 768w" type="image/jpeg"><source media="(min-width: 769px)" srcset="large.jpg 1440w" type="image/jpeg"><img src="fallback.jpg" alt="描述文本" loading="lazy"width="800" height="600">
</picture><script>
// 高级懒加载与交叉观察器
document.addEventListener('DOMContentLoaded', () => {const imageObserver = new IntersectionObserver((entries, observer) => {entries.forEach(entry => {if (entry.isIntersecting) {const img = entry.target;const src = img.getAttribute('data-src');// 创建图像预加载const preloadImg = new Image();preloadImg.onload = () => {img.src = src;img.classList.add('loaded');};preloadImg.src = src;// 图片已处理,停止观察observer.unobserve(img);}});}, {rootMargin: '200px 0px', // 提前200px开始加载threshold: 0.01 // 仅需很小一部分可见即开始加载});// 应用到所有懒加载图片document.querySelectorAll('img[data-src]').forEach(img => {imageObserver.observe(img);});
});
</script>

渲染性能优化

// 避免强制同步布局
// 问题代码
function animateBoxes(boxes) {boxes.forEach(box => {const height = box.offsetHeight; // 读取box.style.height = (height * 2) + 'px'; // 写入// 读后写,下一次迭代时会强制同步布局const width = box.offsetWidth; // 再次读取,触发强制同步布局!box.style.width = (width * 2) + 'px'; // 写入});
}// 优化代码
function animateBoxesOptimized(boxes) {// 批量读取const dimensions = boxes.map(box => ({height: box.offsetHeight,width: box.offsetWidth}));// 批量写入boxes.forEach((box, i) => {const { height, width } = dimensions[i];box.style.height = (height * 2) + 'px';box.style.width = (width * 2) + 'px';});
}// 复合层优化
function promoteToLayer(element) {// 提升元素到独立图层element.style.transform = 'translateZ(0)';// 或使用will-change属性提示浏览器element.style.willChange = 'transform';
}// 在动画前应用,动画后移除
function optimizeAnimation(element, duration) {promoteToLayer(element);// 执行动画element.classList.add('animate');// 动画结束后移除优化setTimeout(() => {element.style.willChange = 'auto';}, duration);
}

构建与交付优化

// webpack生产配置示例
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');module.exports = {mode: 'production',entry: './src/index.js',output: {path: path.resolve(__dirname, 'dist'),filename: '[name].[contenthash].js',chunkFilename: '[name].[contenthash].chunk.js',clean: true},optimization: {minimizer: [new TerserPlugin({terserOptions: {compress: {drop_console: true,}}}),new CssMinimizerPlugin()],splitChunks: {chunks: 'all',maxInitialRequests: Infinity,minSize: 0,cacheGroups: {vendor: {test: /[\\/]node_modules[\\/]/,name(module) {// 为node_modules中每个包创建单独的chunkconst packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];return `vendor.${packageName.replace('@', '')}`;}}}}},module: {rules: [{test: /\.js$/,exclude: /node_modules/,use: {loader: 'babel-loader',options: {presets: [['@babel/preset-env', { useBuiltIns: 'usage',corejs: 3 }]],plugins: ['@babel/plugin-transform-runtime']}}},{test: /\.css$/,use: [MiniCssExtractPlugin.loader,'css-loader','postcss-loader']},{test: /\.(png|svg|jpg|jpeg|gif)$/i,type: 'asset',parser: {dataUrlCondition: {maxSize: 8 * 1024 // 8KB}},generator: {filename: 'images/[hash][ext][query]'}}]},plugins: [new MiniCssExtractPlugin({filename: '[name].[contenthash].css'}),new HtmlWebpackPlugin({template: './src/index.html',minify: {removeComments: true,collapseWhitespace: true,removeRedundantAttributes: true,useShortDoctype: true,removeEmptyAttributes: true,removeStyleLinkTypeAttributes: true,keepClosingSlash: true,minifyJS: true,minifyCSS: true,minifyURLs: true}}),new CompressionPlugin({algorithm: 'gzip',test: /\.(js|css|html|svg)$/,threshold: 10240,minRatio: 0.8}),new BundleAnalyzerPlugin({analyzerMode: 'static',openAnalyzer: false,reportFilename: 'bundle-report.html'})]
};

性能监控与持续优化

实时监控解决方案

// 自定义性能监控系统
class PerformanceMonitor {constructor(options = {}) {this.apiEndpoint = options.apiEndpoint || '/analytics/performance';this.sampleRate = options.sampleRate || 0.1; // 采样10%的用户this.userId = this.generateUserId();this.sessionId = this.generateSessionId();this.events = [];this.maxBatchSize = options.maxBatchSize || 10;this.initMetrics();// 在页面卸载前发送数据window.addEventListener('beforeunload', this.sendMetrics.bind(this));// 定期发送数据setInterval(this.sendMetrics.bind(this), 60000); // 每分钟}shouldSample() {return Math.random() <= this.sampleRate;}generateUserId() {return localStorage.getItem('userId') || `user_${Math.random().toString(36).substring(2, 15)}`;}generateSessionId() {return `session_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;}initMetrics() {if (!this.shouldSample()) return;// 收集导航性能this.collectNavigationTiming();// 监控Web Vitalsthis.monitorWebVitals();// 监控长任务this.monitorLongTasks();// 监控资源加载this.monitorResourceLoading();// 监控错误this.monitorErrors();// 监控用户交互this.monitorInteractions();}collectNavigationTiming() {window.addEventListener('load', () => {setTimeout(() => {const navigation = performance.getEntriesByType('navigation')[0];const timing = {dnsLookup: navigation.domainLookupEnd - navigation.domainLookupStart,tcpConnect: navigation.connectEnd - navigation.connectStart,request: navigation.responseStart - navigation.requestStart,response: navigation.responseEnd - navigation.responseStart,domProcessing: navigation.domComplete - navigation.responseEnd,domLoaded: navigation.domContentLoadedEventEnd - navigation.navigationStart,loadComplete: navigation.loadEventEnd - navigation.navigationStart};this.addEvent('navigation', timing);}, 0);});}monitorWebVitals() {import('web-vitals').then(({ onFCP, onLCP, onCLS, onFID, onTTFB }) => {onFCP(metric => this.addEvent('fcp', metric));onLCP(metric => this.addEvent('lcp', metric));onCLS(metric => this.addEvent('cls', metric));onFID(metric => this.addEvent('fid', metric));onTTFB(metric => this.addEvent('ttfb', metric));});}monitorLongTasks() {if (!window.PerformanceObserver) return;const observer = new PerformanceObserver(list => {list.getEntries().forEach(entry => {this.addEvent('longTask', {duration: entry.duration,startTime: entry.startTime,attribution: entry.attribution});});});observer.observe({ entryTypes: ['longtask'] });}monitorResourceLoading() {if (!window.PerformanceObserver) return;const observer = new PerformanceObserver(list => {list.getEntries().forEach(entry => {// 过滤掉分析请求本身if (entry.name.includes(this.apiEndpoint)) return;this.addEvent('resource', {name: entry.name,initiatorType: entry.initiatorType,duration: entry.duration,transferSize: entry.transferSize,decodedBodySize: entry.decodedBodySize});});});observer.observe({ entryTypes: ['resource'] });}monitorErrors() {window.addEventListener('error', event => {this.addEvent('error', {message: event.message,source: event.filename,lineno: event.lineno,colno: event.colno,timestamp: Date.now()});});window.addEventListener('unhandledrejection', event => {this.addEvent('promise_error', {message: event.reason?.message || 'Unhandled Promise Rejection',timestamp: Date.now()});});}monitorInteractions() {const clickableElements = ['button', 'a', '.clickable', '[role="button"]'];document.addEventListener('click', event => {const target = event.target;// 检查是否点击了可交互元素const isClickable = clickableElements.some(selector => target.matches && (target.matches(selector) || target.closest(selector)));if (isClickable) {const elementId = target.id || '';const className = target.className || '';const tagName = target.tagName || '';const text = target.innerText?.substring(0, 50) || '';this.addEvent('interaction', {type: 'click',elementId,className,tagName,text,timestamp: Date.now(),path: window.location.pathname});}});}addEvent(type, data) {this.events.push({type,data,timestamp: Date.now(),url: window.location.href,userAgent: navigator.userAgent,userId: this.userId,sessionId: this.sessionId});if (this.events.length >= this.maxBatchSize) {this.sendMetrics();}}sendMetrics() {if (this.events.length === 0) return;// 克隆待发送事件const eventsToSend = [...this.events];this.events = [];// 创建beacon请求const blob = new Blob([JSON.stringify(eventsToSend)], {type: 'application/json'});// 尝试使用Beacon APIif (navigator.sendBeacon) {const sent = navigator.sendBeacon(this.apiEndpoint, blob);if (sent) return;}// 回退到Fetch APIfetch(this.apiEndpoint, {method: 'POST',body: blob,keepalive: true,headers: { 'Content-Type': 'application/json' }}).catch(err => console.error('Failed to send metrics', err));}
}// 使用监控系统
const monitor = new PerformanceMonitor({apiEndpoint: 'https://analytics.example.com/performance',sampleRate: 0.1,maxBatchSize: 15
});// 添加自定义性能标记
function measureCustomOperation(name, operation) {const startMark = `${name}-start`;const endMark = `${name}-end`;performance.mark(startMark);const result = operation();performance.mark(endMark);performance.measure(name, startMark, endMark);const metrics = performance.getEntriesByName(name, 'measure');if (metrics.length > 0) {monitor.addEvent('custom_measure', {name,duration: metrics[0].duration});}return result;
}// 示例使用
function expensiveOperation() {return measureCustomOperation('product-filter', () => {// 执行产品过滤return products.filter(p => p.price > 100);});
}

结语

前端性能优化是一个系统性工程,需要从资源加载、渲染效率、JavaScript执行和用户体验多维度进行分析和改进。利用相关的工具和指标,结合实战案例中的优化技巧,可以系统性地提升Web应用的性能表现。

最佳实践是将性能监测集成到开发流程中,通过持续监控和优化迭代,确保应用在不断发展的同时保持卓越的性能表现。技术细节和具体实现应根据项目需求灵活调整,但性能优先的开发理念应始终贯穿整个前端开发生命周期。

参考资源

官方文档与指南

  • Web Vitals - Google web.dev
  • MDN Web Performance
  • Chrome DevTools Performance 面板文档
  • Lighthouse 文档
  • Fast load times - Google web.dev

性能测量工具

  • PageSpeed Insights
  • WebPageTest
  • Sitespeed.io
  • SpeedCurve
  • Web Vitals Chrome 扩展

优化技术与最佳实践

  • The Cost of JavaScript - V8 团队
  • 前端性能清单 2023
  • 图像优化指南
  • JavaScript 启动优化
  • HTTP 缓存策略

开源库与框架

  • Web Vitals JS 库
  • Perfume.js - 前端性能监测
  • bundlesize - 监控打包大小
  • Squoosh - 图像优化工具
  • Preload, Prefetch 和 Preconnect 加载器

博客、文章与社区

  • Smashing Magazine - 性能专题
  • CSS-Tricks - 性能相关文章
  • Performance Calendar
  • Addy Osmani 的性能文章
  • Frontend Masters - 网页性能课程

实用工具与服务

  • Datadog Real User Monitoring
  • New Relic Browser Monitoring
  • Cloudflare Web Analytics
  • BrowserStack SpeedLab
  • Calibre App

如果你觉得这篇文章有帮助,欢迎点赞收藏,也期待在评论区看到你的想法和建议!👇

终身学习,共同成长。

咱们下一期见

💻

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.pswp.cn/bicheng/85458.shtml
繁体地址,请注明出处:http://hk.pswp.cn/bicheng/85458.shtml
英文地址,请注明出处:http://en.pswp.cn/bicheng/85458.shtml

如若内容造成侵权/违法违规/事实不符,请联系英文站点网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

LeeCode2294划分数组使最大值为K

项目场景&#xff1a; 给你一个整数数组 nums 和一个整数 k 。你可以将 nums 划分成一个或多个 子序列 &#xff0c;使 nums 中的每个元素都 恰好 出现在一个子序列中。 在满足每个子序列中最大值和最小值之间的差值最多为 k 的前提下&#xff0c;返回需要划分的 最少 子序列…

中国医科大借iMeta影响因子跃升至33.2(中科院1区)东风,凭多组学联合生信分析成果登刊

中国医科大借iMeta影响因子跃升至33.2&#xff08;中科院1区&#xff09;东风&#xff0c;凭多组学联合生信分析成果登刊 2025年6月18日&#xff0c;科睿唯安正式发布了2024年期刊的最新影响因子(发送关键词 “2024JIF” 至 “生信学术纵览”&#xff0c;即可下载完整版最新影…

百度垂搜数据管理系统弹性调度优化实践

百度垂直搜索系统将搜索核心能力赋能阿拉丁&#xff08;百度搜索特型结果&#xff09;、垂直领域搜索、应用内搜索等场景&#xff0c;支撑了数百个检索场景、百亿级内容数据的检索。随着接入业务数量和数据量不断增长&#xff0c;系统在海量数据管理与调度上遭遇新的挑战&#…

什么是Nacos?

Nacos&#xff08;Naming and Configuration Service&#xff09;是一个由阿里巴巴开源的动态服务发现、配置管理和服务管理平台&#xff0c;专为云原生应用设计。它是构建微服务架构的核心基础设施之一&#xff0c;主要解决分布式系统中的服务注册发现和动态配置管理两大核心问…

golang excel导出时需要显示刷新

"github.com/xuri/excelize/v2"包导出excel文件时在调用WriteTo函数前需要显式关闭流写入器 if err : sw.Flush(); err ! nil { return nil, err } &#xff0c;否则会造成excel文件使用excel打开时出现问题&#xff0c;但是用wps打开文件就没有此问题 详细代码&…

Make RL Great Again:大语言模型时代的强化学习推理丨记深度推理模型论坛

进入2025年&#xff0c;大模型依赖Scaling Law提升性能的方式正面临边际递减。一方面算力成本居高不下&#xff0c;另一方面训练效率与推理质量难以兼顾。在这种背景下&#xff0c;模型正悄然从“模仿机器”转向“思考引擎”。 6月7日&#xff0c;以“推理”为核心的智源大会深…

MATLAB R2025a安装教程

软件介绍 MATLAB 是由MathWorks公司开发的高级数值计算软件&#xff0c;在工程计算、数据分析和算法开发领域应用广泛&#xff0c;以下是其相关介绍&#xff1a; 功能特点 ・矩阵运算与可视化&#xff1a;提供强大的矩阵处理能力&#xff0c;内置丰富的绘图函数&#xff0c;可快…

Flink CDC MySQL 表字段定义为 decimal 输出乱码问题优雅解决方式

Flink CDC MySQL 表字段定义为 decimal 输出乱码问题解析 代码运行环境 Flink 1.15 + FlinkCDC 2.4.0 + jdk1.8 +springboot 2.31、原因分析 Flink CDC 底层使用 Debezium 连接器来捕获 MySQL 的数据变更。当 MySQL 表中的字段类型为 decimal 时,Debezium 默认会将 decimal…

spring-webmvc @ResponseStatus 典型用法

典型用法 为某个接口指定固定的 HTTP 状态码&#xff08;如创建成功返回 201&#xff09; 当该方法执行成功时&#xff0c;HTTP 响应状态码会是 201 Created。 适用于不需要动态控制状态码的场景。 PostMapping("/users") ResponseStatus(HttpStatus.CREATED) pub…

鸿蒙Next仓颉语言开发实战教程:设置页面

仓颉语言商城应用的页面开发教程接近尾声了&#xff0c;今天要分享的是设置页面&#xff1a; 导航栏还是老样式&#xff0c;介绍过很多次了&#xff0c;今天不再赘述。这个页面的内容主要还是介绍List容器的使用。 可以看出列表内容分为三组&#xff0c;所以我们要用到ListIte…

Redis 第三讲 --- 指令篇 通用命令(一)

前言&#xff1a; 在《Redis 第二讲》中&#xff0c;我们完成了 Redis 的安装与环境配置&#xff0c;为实际操作奠定了基础。本讲将正式进入 Redis 的核心领域——指令操作。我们将从最基础的键值操作开始&#xff0c;逐步掌握数据读写、键管理及生产环境注意事项&#xff0c;…

数字媒体专业课程介绍以及就业方向

专业课程体系融合艺术创作与技术实践,旨在培养兼具美学素养和产业应用能力的复合型人才。以下是核心课程模块及代表性课程,涵盖从基础到高阶的全流程训练: 🎨 一、核心课程体系 艺术基础课程 绘画训练:素描、速写、色彩理论、构成艺术,培养造型能力与色彩运用2610。 动…

Spring-创建第一个SpringBoot项目

目录 一.使用IDEA创建 1.专业版 2.社区版 二.使用网页创建项目 三.项目目录介绍 一.使用IDEA创建 1.专业版 修改Server URL为https://start.aliyun.com 2.社区版 这里需要注意对应的IDEA版本&#xff0c;版本不对导入无法使用。 不需要解压&#xff0…

【数据分析三:Data Storage】数据存储

数据真是越来越多啊 正文开始 一、数据 结构化数据 可以使用关系型数据库表示和存储的数据&#xff0c;拥有固定结构 半结构化数据 弱结构化&#xff0c;虽然不符合关系型数据模型的要求&#xff0c;但是含有相关的标记(自描述结构)&#xff0c;分割实体及其属性 。如&#xf…

Spring Boot 整合 Spring AI 与 MCP 开发智能体工具指南

Spring Boot 整合 Spring AI 与 MCP 开发智能体工具指南 一、引言 随着大语言模型(LLM)的普及&#xff0c;越来越多的开发者希望将其集成到自己的应用中。Spring AI 作为 Spring 生态下的 AI 集成框架&#xff0c;提供了便捷的方式来对接各种大模型。而 MCP(Model Context Pr…

【开源项目】GraphRAG Agent:可解释、可推理的下一代智能问答系统

GraphRAG Agent&#xff1a;可解释、可推理的下一代智能问答系统 ​​引言​​ 传统 RAG&#xff08;检索增强生成&#xff09;系统常因“黑盒推理”和上下文断裂被诟病。微软开源的 GraphRAG 框架尝试用知识图谱解决这一问题&#xff0c;而​​Graph RAG Agent​​&#xff0…

【论文笔记】【强化微调】AgentThink:思维链推理 + 工具调用

AgentThink: A Unified Framework for Tool-Augmented Chain-of-Thought Reasoning in Vision-Language Models for Autonomous Driving 1. 引述 这是一篇自动驾驶领域的论文。我对这篇论文主要感兴趣的点在于其对于工具调用&#xff08;Tool Call&#xff09;的设计。这一点同…

前端页面Javascript进阶DOM与BOM

一、DOM基础概念 DOM 是文档对象模型&#xff0c;提供编程接口用于操作 HTML 和 XML 文档。它将文档表示为节点树&#xff0c;每个节点代表文档的一部分&#xff0c;如元素、文本、属性等。通过 DOM&#xff0c;开发者可以访问和修改文档的结构、样式与内容。 文档节点类型 …

AWS CloudFormation深度解析:构建现代云原生应用基础设施

在现代云原生应用开发中,基础设施即代码(Infrastructure as Code, IaC)已成为标准实践。本文将深入解析一个完整的AWS CloudFormation模板,该模板为GlowChat Connector应用构建了生产级的基础设施。 模板概述 这个CloudFormation模板是一个两部分部署架构中的第一部分,专…

Oracle 查看所有表的字段名、数据类型及长度

1.只查看某个特定表的字段名 SELECT column_name, data_type, data_length FROM user_tab_columns WHERE table_name 你的表名 -- 注意大写 ORDER BY column_id;2.查看当前用户下所有表的字段名 SELECT table_name, column_name, data_type, data_length FROM user_tab_colu…