gitpan / class-accessor-inherited-xs Goto Github PK
View Code? Open in Web Editor NEWRead-only release history for Class-Accessor-Inherited-XS
Home Page: http://metacpan.org/release/Class-Accessor-Inherited-XS
Read-only release history for Class-Accessor-Inherited-XS
Home Page: http://metacpan.org/release/Class-Accessor-Inherited-XS
NAME Class::Accessor::Inherited::XS - fast XS inherited accessors SYNOPSIS #install accessors at compile time use Class::Accessor::Inherited::XS inherited => [qw/foo bar/], # here key names are equal to accessor names ; use Class::Accessor::Inherited::XS { # optional braces inherited => { bar => 'bar_key', foo => 'foo_key', }, }; #or in a Class::Accessor::Grouped-like fashion use parent 'Class::Accessor::Inherited::XS'; __PACKAGE__->mk_inherited_accessors('foo', ['bar', 'bar_key']); DESCRIPTION This module provides very fast implementation for 'inherited' accessors, that were introduced in Class::Accessor::Grouped. They give you capability to override values set in a parent class with values set in childs or object instances. Generated accessors are compatible with Class::Accessor::Grouped generated ones. Since this module focuses primary on speed, it provides no capability to have your own per-class getters/setters logic (like overriding get_inherited/set_inherited in Class::Accessor::Grouped). UTF-8 Starting with perl 5.16.0, this module provides full support for UTF-8 method names and hash keys. Before that, you can't distinguish UTF-8 strings from bytes string in method names, only in hash keys. You have been warned. THREADS Though highly discouraged, perl threads are supported by Class::Accessor::Inherited::XS. You may have accessors with the same names pointing to different keys in different threads, etc. There are no known conceptual leaks. PERFORMANCE Class::Accessor::Inherited::XS is at least 10x times faster than Class::Accessor::Grouped, depending on your usage pattern. Accessing data from a parent in large inheritance chain is still the worst case, but even there Class::Accessor::Inherited::XS beats Class::Accessor::Grouped best-case. You can see some benchmarks by running bench/bench.pl PROFILING WITH Devel::NYTProf To perform it's work, Devel::NYTProf hooks into perl interpreter by replacing default behaviour for calling subroutines on the opcode level. To squeeze last bits of performance, Class::Accessor::Inherited::XS does the same, but separately on each call site of it's accessors. It turns out into CAIX favor - Devel::NYTProf sees only first call to CAIX accessor sub, but then those calls become 'invisible' for subs profiler. Note that, statement profiler still correctly accounts time spent on the line, you just don't see time spent in accessors' calls separately. That's sometimes OK, sometimes not - you get profile with all possible optimizations on, but not very easy to be read. Since it's hard to detect Devel::NYTProf (and any other module doing such magic) in a portable way (all hail Win32), there's an %ENV switch available - you can set CAIXS_DISABLE_ENTERSUB to true value to disable call site optimization and get full subs profile. SEE ALSO * Class::Accessor::Grouped * Class::XSAccessor COPYRIGHT AND LICENSE Copyright (C) 2009 by Vladimir Timofeev Copyright (C) 2014 by Sergey Aleynikov This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.