“javalangString”内部:理解和优化实例化性能

“javalangstring”内部:理解和优化实例化性能

java.lang.string 可能是 java 中最常用的类之一。当然,它内部包含其字符串数据。但是,您知道这些数据实际上是如何存储的吗?在这篇文章中,我们将探讨 java.lang.string 的内部结构并讨论提高实例化性能的方法。

java 8 或更早版本中 java.lang.string 的内部结构

在 java 8 中,java.lang.string 将其字符串数据包含为 16 位字符数组。

public final class string    implements java.io.serializable, comparable, charsequence {    /** the value is used for character storage. */    private final char value[];

从字节数组实例化 string 时,最终会调用 stringcoding.decode()。

    public string(byte bytes[], int offset, int length, charset charset) {        if (charset == null)            throw new nullpointerexception("charset");        checkbounds(bytes, offset, length);        this.value =  stringcoding.decode(charset, bytes, offset, length);    }

对于us_ascii,最终会调用sun.nio.cs.us_ascii.decoder.decode(),将源字节数组的字节一一复制到char数组中。

        public int decode(byte[] src, int sp, int len, char[] dst) {            int dp = 0;            len = math.min(len, dst.length);            while (dp = 0)                    dst[dp++] = (char)b;                else                    dst[dp++] = repl;            }            return dp;        }

新创建的 char 数组用作新 string 实例的 char 数组值。

正如您所注意到的,即使源字节数组仅包含单字节字符,也会发生字节到字符的复制迭代。

java 9或更高版本中java.lang.string的内部结构

在 java 9 或更高版本中,java.lang.string 将其字符串数据包含为 8 位字节数组。

public final class string    implements java.io.serializable, comparable, charsequence {    /**     * the value is used for character storage.     *     * @implnote this field is trusted by the vm, and is a subject to     * constant folding if string instance is constant. overwriting this     * field after construction will cause problems.     *     * additionally, it is marked with {@link stable} to trust the contents     * of the array. no other facility in jdk provides this functionality (yet).     * {@link stable} is safe here, because value is never null.     */    @stable    private final byte[] value;

从字节数组实例化 string 时,还会调用 stringcoding.decode()。

    public string(byte bytes[], int offset, int length, charset charset) {        if (charset == null)            throw new nullpointerexception("charset");        checkboundsoffcount(offset, length, bytes.length);        stringcoding.result ret =            stringcoding.decode(charset, bytes, offset, length);        this.value = ret.value;        this.coder = ret.coder;    }

对于 us_ascii,调用 stringcoding.decodeascii(),它使用 arrays.copyofrange() 复制源字节数组,因为源和目标都是字节数组。 arrays.copyofrange() 内部使用 system.arraycopy(),这是一个本机方法并且速度非常快。

    private static result decodeascii(byte[] ba, int off, int len) {        result result = resultcached.get();        if (compact_strings && !hasnegatives(ba, off, len)) {            return result.with(arrays.copyofrange(ba, off, off + len),                               latin1);        }        byte[] dst = new byte[len<<1];        int dp = 0;        while (dp = 0) ? (char)b : repl);        }        return result.with(dst, utf16);    }

您可能会注意到 compact_strings 常量。 java 9 中引入的这一改进称为紧凑字符串。该功能默认启用,但您可以根据需要禁用它。详情请参阅https://docs.oracle.com/en/java/javase/17/vm/java-hotspot-virtual-machine-performance-enhancements.html#guid-d2e3dc58-d18b-4a6c-8167-4a1dfb4888e4。

立即学习“Java免费学习笔记(深入)”;

java 8、11、17 和 21 中 new string(byte[]) 的性能

我编写了这个简单的 jmh 基准代码来评估 new string(byte[]) 的性能:

@state(scope.benchmark)@outputtimeunit(timeunit.milliseconds)@fork(1)@measurement(time = 3, iterations = 4)@warmup(iterations = 2)public class stringinstantiationbenchmark {  private static final int str_len = 512;  private static final byte[] single_byte_str_source_bytes;  private static final byte[] multi_byte_str_source_bytes;  static {    {      stringbuilder sb = new stringbuilder();      for (int i = 0; i < str_len; i++) {        sb.append("x");      }      single_byte_str_source_bytes = sb.tostring().getbytes(standardcharsets.utf_8);    }    {      stringbuilder sb = new stringbuilder();      for (int i = 0; i < str_len / 2; i++) {        sb.append("あ");      }      multi_byte_str_source_bytes = sb.tostring().getbytes(standardcharsets.utf_8);    }  }  @benchmark  public void newstrfromsinglebytestrbytes() {    new string(single_byte_str_source_bytes, standardcharsets.utf_8);  }  @benchmark  public void newstrfrommultibytestrbytes() {    new string(multi_byte_str_source_bytes, standardcharsets.utf_8);  }}

基准测试结果如下:

java 8

benchmark                        mode  cnt     score     error   unitsnewstrfrommultibytestrbytes     thrpt    4  1672.397 ±  11.338  ops/msnewstrfromsinglebytestrbytes    thrpt    4  4789.745 ± 553.865  ops/ms

java 11

benchmark                        mode  cnt      score      error   unitsnewstrfrommultibytestrbytes     thrpt    4   1507.754 ±   17.931  ops/msnewstrfromsinglebytestrbytes    thrpt    4  15117.040 ± 1240.981  ops/ms

java 17

benchmark                        mode  cnt      score     error   unitsnewstrfrommultibytestrbytes     thrpt    4   1529.215 ± 168.064  ops/msnewstrfromsinglebytestrbytes    thrpt    4  17753.086 ± 251.676  ops/ms

java 21

benchmark                        mode  cnt      score      error   unitsnewstrfrommultibytestrbytes     thrpt    4   1543.525 ±   69.061  ops/msnewstrfromsinglebytestrbytes    thrpt    4  17711.972 ± 1178.212  ops/ms

newstrfromsinglebytestrbytes() 的吞吐量从 java 8 到 java 11 得到了极大的提高。这可能是因为 string 类中从 char 数组更改为 byte 数组。

通过零复制进一步提高性能

好的,紧凑字符串是一个很大的性能改进。但是从字节数组实例化 string 的性能没有提高的空间吗? java 9 或更高版本中的 string(byte bytes[], int offset, int length, charset charset) 复制字节数组。即使它使用 system.copyarray() 这是一个原生方法并且速度很快,但也需要一些时间。

当我阅读 apache fury 的源代码时,它是“一个由 jit(即时编译)和零拷贝驱动的极快的多语言序列化框架”,我发现他们的 stringserializer 实现了零拷贝字符串实例化。让我们看看具体的实现。

网龙b2b仿阿里巴巴电子商务平台 网龙b2b仿阿里巴巴电子商务平台

本系统经过多次升级改造,系统内核经过多次优化组合,已经具备相对比较方便快捷的个性化定制的特性,用户部署完毕以后,按照自己的运营要求,可实现快速定制会费管理,支持在线缴费和退费功能财富中心,管理会员的诚信度数据单客户多用户登录管理全部信息支持审批和排名不同的会员级别有不同的信息发布权限企业站单独生成,企业自主决定更新企业站信息留言、询价、报价统一管理,分系统查看分类信息参数化管理,支持多样分类信息,

网龙b2b仿阿里巴巴电子商务平台 0 查看详情 网龙b2b仿阿里巴巴电子商务平台

stringserializer的用法如下:

import org.apache.fury.serializer.stringserializer;...    byte[] bytes = "hello".getbytes();    string s = stringserializer.newbytesstringzerocopy(latin1, bytes);

stringserializer.newbytesstringzerocopy()最终实现的是调用非public string构造函数new string(byte[], byte coder),将源字节数组直接设置为string.value,而不需要复制字节。

stringserializer 有以下 2 个常量:

  private static final bifunction bytes_string_zero_copy_ctr =      getbytesstringzerocopyctr();  private static final function latin_bytes_string_zero_copy_ctr =      getlatinbytesstringzerocopyctr();

bytes_string_zero_copy_ctr 被初始化为从 getbytesstringzerocopyctr() 返回的 bifunction:

  private static bifunction getbytesstringzerocopyctr() {    if (!string_value_field_is_bytes) {      return null;    }    methodhandle handle = getjavastringzerocopyctrhandle();    if (handle == null) {      return null;    }    // faster than handle.invokeexact(data, byte)    try {      methodtype instantiatedmethodtype =          methodtype.methodtype(handle.type().returntype(), new class[] {byte[].class, byte.class});      callsite callsite =          lambdametafactory.metafactory(              string_look_up,              "apply",              methodtype.methodtype(bifunction.class),              handle.type().generic(),              handle,              instantiatedmethodtype);      return (bifunction) callsite.gettarget().invokeexact();    } catch (throwable e) {      return null;    }  }

该方法返回一个 bifunction,它接收 byte[] 值、字节编码器作为参数。该函数调用 methodhandle
对于 string 构造函数 new string(byte[] value, byte coder)。我不知道通过 lambdametafactory.metafactory() 调用 methodhandle 的技术,但它看起来比 methodhandle.invokeexact() 更快。

latin_bytes_string_zero_copy_ctr 被初始化为从 getlatinbytesstringzerocopyctr() 返回的函数:

  private static function getlatinbytesstringzerocopyctr() {    if (!string_value_field_is_bytes) {      return null;    }    if (string_look_up == null) {      return null;    }    try {      class clazz = class.forname("java.lang.stringcoding");      methodhandles.lookup caller = string_look_up.in(clazz);      // jdk17 removed this method.      methodhandle handle =          caller.findstatic(              clazz, "newstringlatin1", methodtype.methodtype(string.class, byte[].class));      // faster than handle.invokeexact(data, byte)      return _jdkaccess.makefunction(caller, handle, function.class);    } catch (throwable e) {      return null;    }  }

该方法返回一个接收 byte[](不需要编码器,因为它仅适用于 latin1)作为参数的函数,如 getbytesstringzerocopyctr()。但是,这个函数调用 methodhandle
改为 stringcoding.newstringlatin1(byte[] src) 。 _jdkaccess.makefunction() 使用 lambdametafactory.metafactory() 以及 getbytesstringzerocopyctr() 包装 methodhandle 的调用。

stringcoding.newstringlatin1() 在 java 17 中被删除。因此,在 java 17 或更高版本中使用 bytes_string_zero_copy_ctr 函数,否则使用 latin_bytes_string_zero_copy_ctr 函数。

stringserializer.newbytesstringzerocopy() 基本上正确调用了存储在常量中的这些函数。

  public static string newbytesstringzerocopy(byte coder, byte[] data) {    if (coder == latin1) {      // 700% faster than unsafe put field in java11, only 10% slower than `new string(str)` for      // string length 230.      // 50% faster than unsafe put field in java11 for string length 10.      if (latin_bytes_string_zero_copy_ctr != null) {        return latin_bytes_string_zero_copy_ctr.apply(data);      } else {        // jdk17 removed newstringlatin1        return bytes_string_zero_copy_ctr.apply(data, latin1_boxed);      }    } else if (coder == utf16) {      // avoid byte box cost.      return bytes_string_zero_copy_ctr.apply(data, utf16_boxed);    } else {      // 700% faster than unsafe put field in java11, only 10% slower than `new string(str)` for      // string length 230.      // 50% faster than unsafe put field in java11 for string length 10.      // `invokeexact` must pass exact params with exact types:      // `(object) data, coder` will throw wrongmethodtypeexception      return bytes_string_zero_copy_ctr.apply(data, coder);    }  }

要点是:

调用非公共 stringcoding.newstringlatin1() 或 new string(byte[] value, byte coder) 以避免字节数组复制尽可能减少反射成本。

是时候进行基准测试了。我更新了 jmh 基准代码如下:

构建.gradle.kts

dependencies {    implementation("org.apache.fury:fury-core:0.9.0")    ...

org/komamitsu/stringinstantiationbench/stringinstantiationbenchmark.java

package org.komamitsu.stringinstantiationbench;import org.apache.fury.serializer.stringserializer;import org.openjdk.jmh.annotations.*;import java.nio.charset.standardcharsets;import java.util.concurrent.timeunit;@state(scope.benchmark)@outputtimeunit(timeunit.milliseconds)@fork(1)@measurement(time = 3, iterations = 4)@warmup(iterations = 2)public class stringinstantiationbenchmark {  private static final int str_len = 512;  private static final byte[] single_byte_str_source_bytes;  private static final byte[] multi_byte_str_source_bytes;  static {    {      stringbuilder sb = new stringbuilder();      for (int i = 0; i < str_len; i++) {        sb.append("x");      }      single_byte_str_source_bytes = sb.tostring().getbytes(standardcharsets.utf_8);    }    {      stringbuilder sb = new stringbuilder();      for (int i = 0; i < str_len / 2; i++) {        sb.append("あ");      }      multi_byte_str_source_bytes = sb.tostring().getbytes(standardcharsets.utf_8);    }  }  @benchmark  public void newstrfromsinglebytestrbytes() {    new string(single_byte_str_source_bytes, standardcharsets.utf_8);  }  @benchmark  public void newstrfrommultibytestrbytes() {    new string(multi_byte_str_source_bytes, standardcharsets.utf_8);  }  // copied from org.apache.fury.serializer.stringserializer.  private static final byte latin1 = 0;  private static final byte latin1_boxed = latin1;  private static final byte utf16 = 1;  private static final byte utf16_boxed = utf16;  private static final byte utf8 = 2;  @benchmark  public void newstrfromsinglebytestrbyteswithzerocopy() {    stringserializer.newbytesstringzerocopy(latin1, single_byte_str_source_bytes);  }  @benchmark  public void newstrfrommultibytestrbyteswithzerocopy() {    stringserializer.newbytesstringzerocopy(utf8, multi_byte_str_source_bytes);  }}

结果如下:

java 11

benchmark                                  mode  cnt        score      error   unitsnewstrfrommultibytestrbytes               thrpt    4     1505.580 ±   13.191  ops/msnewstrfrommultibytestrbyteswithzerocopy   thrpt    4  2284141.488 ± 5509.077  ops/msnewstrfromsinglebytestrbytes              thrpt    4    15246.342 ±  258.381  ops/msnewstrfromsinglebytestrbyteswithzerocopy  thrpt    4  2281817.367 ± 8054.568  ops/ms

java 17

benchmark                                  mode  cnt        score       error   unitsnewstrfrommultibytestrbytes               thrpt    4     1545.503 ±    15.283  ops/msnewstrfrommultibytestrbyteswithzerocopy   thrpt    4  2273566.173 ± 10212.794  ops/msnewstrfromsinglebytestrbytes              thrpt    4    17598.209 ±   253.282  ops/msnewstrfromsinglebytestrbyteswithzerocopy  thrpt    4  2277213.103 ± 13380.823  ops/ms

java 21

benchmark                                  mode  cnt        score        error   unitsnewstrfrommultibytestrbytes               thrpt    4     1556.272 ±     16.482  ops/msnewstrfrommultibytestrbyteswithzerocopy   thrpt    4  3698101.264 ± 429945.546  ops/msnewstrfromsinglebytestrbytes              thrpt    4    17803.149 ±    204.987  ops/msnewstrfromsinglebytestrbyteswithzerocopy  thrpt    4  3817357.204 ±  89376.224  ops/ms

由于 npe,java 8 的基准测试代码失败。可能是我用的方法不对。

stringserializer.newbytesstringzerocopy() 的性能在 java 17 中比普通 new string(byte[] bytes, charset charset) 快 100 多倍,在 java 21 中快 200 多倍。也许这就是 fury 速度如此之快的秘密之一。

使用这种零复制策略和实现的一个可能的问题是传递给 new string(byte[] value, byte coder) 的字节数组可能由多个对象拥有;新的 string 对象和引用字节数组的对象。

    byte[] bytes = "Hello".getBytes();    String s = StringSerializer.newBytesStringZeroCopy(LATIN1, bytes);    System.out.println(s);    // >>> Hello    bytes[4] = '!';    System.out.println(s);    // >>> Hell!

这种可变性可能会导致字符串内容意外更改的问题。

结论

如果您使用 java 8,就 string 实例化的性能而言,请尽可能使用 java 9 或更高版本。有一种技术可以通过零拷贝从字节数组实例化字符串。速度快得惊人。

以上就是“javalangString”内部:理解和优化实例化性能的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/946776.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2025年12月1日 17:02:27
下一篇 2025年12月1日 17:02:48

相关推荐

  • 旋转长方形后,如何计算其相对于画布左上角的轴距?

    绘制长方形并旋转,计算旋转后轴距 在拥有 1920×1080 画布中,放置一个宽高为 200×20 的长方形,其坐标位于 (100, 100)。当以任意角度旋转长方形时,如何计算它相对于画布左上角的 x、y 轴距? 以下代码提供了一个计算旋转后长方形轴距的解决方案: const x = 200;co…

    2025年12月24日
    000
  • 旋转长方形后,如何计算它与画布左上角的xy轴距?

    旋转后长方形在画布上的xy轴距计算 在画布中添加一个长方形,并将其旋转任意角度,如何计算旋转后的长方形与画布左上角之间的xy轴距? 问题分解: 要计算旋转后长方形的xy轴距,需要考虑旋转对长方形宽高和位置的影响。首先,旋转会改变长方形的长和宽,其次,旋转会改变长方形的中心点位置。 求解方法: 计算旋…

    2025年12月24日
    000
  • 旋转长方形后如何计算其在画布上的轴距?

    旋转长方形后计算轴距 假设长方形的宽、高分别为 200 和 20,初始坐标为 (100, 100),我们将它旋转一个任意角度。根据旋转矩阵公式,旋转后的新坐标 (x’, y’) 可以通过以下公式计算: x’ = x * cos(θ) – y * sin(θ)y’ = x * …

    2025年12月24日
    000
  • 如何计算旋转后长方形在画布上的轴距?

    旋转后长方形与画布轴距计算 在给定的画布中,有一个长方形,在随机旋转一定角度后,如何计算其在画布上的轴距,即距离左上角的距离? 以下提供一种计算长方形相对于画布左上角的新轴距的方法: const x = 200; // 初始 x 坐标const y = 90; // 初始 y 坐标const w =…

    2025年12月24日
    200
  • CSS元素设置em和transition后,为何载入页面无放大效果?

    css元素设置em和transition后,为何载入无放大效果 很多开发者在设置了em和transition后,却发现元素载入页面时无放大效果。本文将解答这一问题。 原问题:在视频演示中,将元素设置如下,载入页面会有放大效果。然而,在个人尝试中,并未出现该效果。这是由于macos和windows系统…

    2025年12月24日
    200
  • 如何计算旋转后的长方形在画布上的 XY 轴距?

    旋转长方形后计算其画布xy轴距 在创建的画布上添加了一个长方形,并提供其宽、高和初始坐标。为了视觉化旋转效果,还提供了一些旋转特定角度后的图片。 问题是如何计算任意角度旋转后,这个长方形的xy轴距。这涉及到使用三角学来计算旋转后的坐标。 以下是一个 javascript 代码示例,用于计算旋转后长方…

    2025年12月24日
    000
  • 如何使用 Ant Design 实现自定义的 UI 设计?

    如何使用 Ant Design 呈现特定的 UI 设计? 一位开发者提出: 我希望使用 Ant Design 实现如下图所示的 UI。作为一个前端新手,我不知从何下手。我尝试使用 a-statistic,但没有任何效果。 为此,提出了一种解决方案: 可以使用一个图表库,例如 echarts.apac…

    2025年12月24日
    000
  • Antdv 如何实现类似 Echarts 图表的效果?

    如何使用 antdv 实现图示效果? 一位前端新手咨询如何使用 antdv 实现如图所示的图示: antdv 怎么实现如图所示?前端小白不知道怎么下手,尝试用了 a-statistic,但没有任何东西出来,也不知道为什么。 针对此问题,回答者提供了解决方案: 可以使用图表库 echarts 实现类似…

    2025年12月24日
    000
  • 如何使用 antdv 创建图表?

    使用 antdv 绘制如所示图表的解决方案 一位初学前端开发的开发者遇到了困难,试图使用 antdv 创建一个特定图表,却遇到了障碍。 问题: 如何使用 antdv 实现如图所示的图表?尝试了 a-statistic 组件,但没有任何效果。 解答: 虽然 a-statistic 组件不能用于创建此类…

    2025年12月24日
    200
  • 如何在 Ant Design Vue 中使用 ECharts 创建一个类似于给定图像的圆形图表?

    如何在 ant design vue 中实现圆形图表? 问题中想要实现类似于给定图像的圆形图表。这位新手尝试了 a-statistic 组件但没有任何效果。 为了实现这样的图表,可以使用 [apache echarts](https://echarts.apache.org/) 库或其他第三方图表库…

    好文分享 2025年12月24日
    100
  • echarts地图中点击图例后颜色变化的原因和修改方法是什么?

    图例颜色变化解析:echarts地图的可视化配置 在使用echarts地图时,点击图例会触发地图颜色的改变。然而,选项中并没有明确的配置项来指定此颜色。那么,这个颜色是如何产生的,又如何对其进行修改呢? 颜色来源:可视化映射 echarts中有一个名为可视化映射(visualmap)的对象,它负责将…

    2025年12月24日
    000
  • 如何在 VS Code 中解决折叠代码复制问题?

    解决 VS Code 折叠代码复制问题 在 VS Code 中使用折叠功能可以帮助组织长代码,但使用复制功能时,可能会遇到只复制可见部分的问题。以下是如何解决此问题: 当代码被折叠时,可以使用以下简单操作复制整个折叠代码: 按下 Ctrl + C (Windows/Linux) 或 Cmd + C …

    2025年12月24日
    000
  • 如何相对定位使用 z-index 在小程序中将文字压在图片上?

    如何在小程序中不使用绝对定位压住上面的图片? 在小程序开发中,有时候需要将文字内容压在图片上,但是又不想使用绝对定位来实现。这种情况可以使用相对定位和 z-index 属性来解决。 问题示例: 小程序中的代码如下: 顶顶顶顶 .index{ width: 100%; height: 100vh;}.…

    2025年12月24日
    000
  • 使用 React 构建 Fylo 云存储网站

    介绍 在这篇博文中,我们将逐步介绍如何使用 react 创建一个功能丰富的云存储网站。该网站受 fylo 启发,提供了主页、功能、工作原理、感言和页脚等部分。在此过程中,我们将讨论用于构建这个完全响应式网站的结构、组件和样式。 项目概况 该项目由多个部分组成,旨在展示云存储服务。每个部分都是用 re…

    2025年12月24日 好文分享
    000
  • 使用 React 构建食谱查找器网站

    介绍 在本博客中,我们将使用 react 构建一个食谱查找网站。该应用程序允许用户搜索他们最喜欢的食谱,查看趋势或新食谱,并保存他们最喜欢的食谱。我们将利用 edamam api 获取实时食谱数据并将其动态显示在网站上。 项目概况 食谱查找器允许用户: 按名称搜索食谱。查看趋势和新添加的食谱。查看各…

    2025年12月24日 好文分享
    200
  • 不可变数据结构:ECMA 4 中的记录和元组

    不可变数据结构:ecmascript 2024 中的新功能 ecmascript 2024 引入了几个令人兴奋的更新,但对我来说最突出的一个功能是引入了不可变数据结构。这些新结构——记录和元组——改变了 javascript 中数据管理的游戏规则。它们提供了一种令人满意的方式来保持我们的数据健全、安…

    2025年12月24日
    000
  • css网页设计模板怎么用

    通过以下步骤使用 CSS 网页设计模板:选择模板并下载到本地计算机。了解模板结构,包括 index.html(内容)和 style.css(样式)。编辑 index.html 中的内容,替换占位符。在 style.css 中自定义样式,修改字体、颜色和布局。添加自定义功能,如 JavaScript …

    2025年12月24日
    000
  • 学会从头开始学习CSS,掌握制作基本网页框架的技巧

    从零开始学习CSS,掌握网页基本框架制作技巧 前言: 在现今互联网时代,网页设计和开发是一个非常重要的技能。而学习CSS(层叠样式表)是掌握网页设计的关键之一。CSS不仅可以为网页添加样式和布局,还可以为用户呈现独特且具有吸引力的页面效果。在本文中,我将为您介绍一些基本的CSS知识,以及一些常用的代…

    2025年12月24日
    200
  • 揭秘Web标准涵盖的语言:了解网页开发必备的语言范围

    在当今数字时代,互联网成为了人们生活中不可或缺的一部分。作为互联网的基本构成单位,网页承载着我们获取和分享信息的重要任务。而网页开发作为一门独特的技术,离不开一些必备的语言。本文将揭秘Web标准涵盖的语言,让我们一起了解网页开发所需的语言范围。 首先,HTML(HyperText Markup La…

    2025年12月24日
    000
  • 揭开Web开发的语言之谜:了解构建网页所需的语言有哪些?

    Web标准中的语言大揭秘:掌握网页开发所需的语言有哪些? 随着互联网的快速发展,网页开发已经成为人们重要的职业之一。而要成为一名优秀的网页开发者,掌握网页开发所需的语言是必不可少的。本文将为大家揭示Web标准中的语言大揭秘,介绍网页开发所需的主要语言。 HTML(超文本标记语言)HTML是网页开发的…

    2025年12月24日
    400

发表回复

登录后才能评论
关注微信