P5-readonly-xs

Jul 20, 2023

Companion module for Readonly.pm, to speed up read-only scalar variables

This module corrects the speed problem, at least with respect to scalar variables. When ReadonlyXS is installed, Readonly uses it to access the internals of scalar variables. Instead of creating a scalar variable object and tying it, Readonly simply flips the SvREADONLY bit in the scalar’s FLAGS structure.

Readonly arrays and hashes are not sped up by this, since the SvREADONLY flag only works for scalars. Arrays and hashes always use the tie interface.

Programs that you write do not need to know whether ReadonlyXS is installed or not. They should just “use Readonly” and let Readonly worry about whether or not it can use XS. If the ReadonlyXS is present, Readonly will be faster. If not, it won’t. Either way, it will still work, and your code will not have to change.

Your program can check whether Readonly.pm is using XS or not by examining the $ReadonlyXSokay variable. It will be true if the XS module was found and is being used. Please do not change this variable.



Checkout these related ports:
  • Zziplib - Library to provide transparent read access to zipped files
  • Zydis - Fast and lightweight x86/x86-64 disassembler library
  • Zycore-c - Support library with platform independent types, macros, etc for Zydis
  • Zthread - Platform-independent object-oriented C++ threading library
  • Zookeeper - Coordination Service for Distributed Applications
  • Zls - Zig LSP implementation + Zig Language Server
  • Zfp - High throughput library for compressed floating-point arrays
  • Zeal - Offline documentation browser
  • Zapcc - C++ caching compiler based on clang
  • Zanata-platform - Web-based translation platform
  • Zanata-cli - Zanata Java command line client
  • Z88dk - Complete Z80/Z180 development kit
  • Z80ex - ZiLOG Z80 CPU emulator library
  • Z80asm - Assembler for the Z80 microprocessor
  • Z80-asm - Z80 assembly code assembler and disassembler