CTO News Hubb
Advertisement
  • Home
  • CTO News
  • IT
  • Technology
  • Tech Topics
    • AI
    • QC
    • Robotics
    • Blockchain
  • Contact
No Result
View All Result
  • Home
  • CTO News
  • IT
  • Technology
  • Tech Topics
    • AI
    • QC
    • Robotics
    • Blockchain
  • Contact
No Result
View All Result
CTO News Hubb
No Result
View All Result
Home IT

Golang 1.21 brings built-in functions, profile-guided optimization

August 10, 2023
in IT


Go 1.21, the latest update of Google’s Go programming language, is now available as a production release. The new version adds built-in functions—min, max, and clear—and makes profile-guided optimization (PGO) generally available. WebAssembly accommodations also are highlighted.

The min and max functions compute the smallest or largest value, respectively, of a fixed number of arguments or ordered types. There must be at least one argument. The clear function takes an argument of map, slice, or type parameter type and deletes or zeroes out all of the elements.

Published August 8, Go 1.21 can be downloaded from the project website. The production release follows a release candidate published June 21.

Profile-guided optimization, introduced as a preview in Go 1.20 in February, graduates from preview status in the new version. PGO enables the compiler toolchain to do workload-specific and application-specific optimizations based on runtime profile information. So far, PGO has improved performance by 2% to 7% when the impact was measured on a wide set of programs, Go project developers said. The Go compiler has been rebuilt with PGO enabled.

Go 1.21 promises additional performance improvements. Tuning the garbage collector could result in some applications seeing as much as a 40% reduction in tail latency, while collecting traces with runtime/trace now incurs a much smaller CPU cost on AMD64 and Arm64 systems.

Elsewhere in Go 1.21:

  • An experimental WASI (WebAssembly System Interface) port is being previewed. To help with writing more general WebAssembly code, the compiler also supports a new wasmimport directive for importing functions from the Wasm host. 
  • The standard library adds a new log/slog package for structured logging. A new slices package is offered for common operations on slices of any element types. This includes sorting functions that are generally faster and more ergonomic than the sort package.
  • The standard library also adds a new maps package for common operations on maps of any key or element type. A new cmp package includes new utilities for comparing ordered values.
  • The go tool now supports both backward and forward language compatibility.
  • Improvements have been made to type inference for generic functions. The description of type inference has been expanded and clarified in the spec.
  • A future version of Go will address a common “gotcha” with the language: loop variable capture. Go 1.21 previews this capability, which can be enabled in code using an environment variable.

Copyright © 2023 IDG Communications, Inc.



Source link

Previous Post

$52.7B CHIPS Act Lures Hundreds of Businesses in First Year

Next Post

Merging physical and digital tools to build resilient supply chains

Next Post

Merging physical and digital tools to build resilient supply chains

Seattle becomes first in U.S. to protect gig workers from sudden 'deactivation'

Trending News

Quality of new vehicles in US declining on more tech use, study shows

June 23, 2023

OPNsense® a true open source security platform and more

June 27, 2023

Our journey at F5 with Apache Arrow (part 2): Adaptive Schemas and Sorting to Optimize Arrow Usage

July 5, 2023

© CTO News Hubb All rights reserved.

Use of these names, logos, and brands does not imply endorsement unless specified. By using this site, you agree to the Privacy Policy and Terms & Conditions.

Navigate Site

  • Home
  • CTO News
  • IT
  • Technology
  • AI
  • QC
  • Robotics
  • Blockchain
  • Contact

Newsletter Sign Up

No Result
View All Result
  • Home
  • CTO News
  • IT
  • Technology
  • Tech Topics
    • AI
    • QC
    • Robotics
    • Blockchain
  • Contact

© 2021 JNews – Premium WordPress news & magazine theme by Jegtheme.

SUBSCRIBE TO OUR WEEKLY NEWSLETTERS