← Index
NYTProf Performance Profile   « block view • line view • sub view »
For mentat.storage.mongo.pl
  Run on Tue Jun 24 09:58:41 2014
Reported on Tue Jun 24 09:59:13 2014

Filename/usr/local/lib/perl/5.14.2/MongoDB/OID.pm
StatementsExecuted 10 statements in 300µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11112µs3.33msMongoDB::OID::::BEGIN@24MongoDB::OID::BEGIN@24
1118µs36µsMongoDB::OID::::BEGIN@72MongoDB::OID::BEGIN@72
0000s0sMongoDB::OID::::TO_JSONMongoDB::OID::TO_JSON
0000s0sMongoDB::OID::::__ANON__[:44]MongoDB::OID::__ANON__[:44]
0000s0sMongoDB::OID::::build_valueMongoDB::OID::build_value
0000s0sMongoDB::OID::::get_timeMongoDB::OID::get_time
0000s0sMongoDB::OID::::to_stringMongoDB::OID::to_string
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1#
2# Copyright 2009-2013 MongoDB, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17package MongoDB::OID;
18{
192900ns $MongoDB::OID::VERSION = '0.702.2';
20}
21
22# ABSTRACT: A Mongo Object ID
23
242251µs26.66ms
# spent 3.33ms (12µs+3.32) within MongoDB::OID::BEGIN@24 which was called: # once (12µs+3.32ms) by MongoDB::BEGIN@33 at line 24
use Moose;
# spent 3.33ms making 1 call to MongoDB::OID::BEGIN@24 # spent 3.32ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:519]
25
26
2712µs11.62mshas value => (
# spent 1.62ms making 1 call to Moose::has
28 is => 'ro',
29 isa => 'Str',
30 required => 1,
31 builder => 'build_value',
32);
33
34around BUILDARGS => sub {
35 my $orig = shift;
36 my $class = shift;
37 if (@_ == 1) {
38 return $class->$orig(value => $_[0])
39 unless ref($_[0]);
40 return $class->$orig(value => $_[0]->value)
41 if blessed($_[0]) && $_[0]->isa($class);
42 }
43 return $class->$orig(@_);
4414µs1289µs};
# spent 289µs making 1 call to Moose::around
45
46sub build_value {
47 my $self = shift;
48
49 _build_value($self, @_ ? @_ : ());
50}
51
52
53sub to_string {
54 my ($self) = @_;
55 $self->value;
56}
57
58
59sub get_time {
60 my ($self) = @_;
61
62 return hex(substr($self->value, 0, 8));
63}
64
65
66sub TO_JSON {
67 my ($self) = @_;
68 return {'$oid' => $self->value};
69}
70
71use overload
72128µs
# spent 36µs (8+28) within MongoDB::OID::BEGIN@72 which was called: # once (8µs+28µs) by MongoDB::BEGIN@33 at line 73
'""' => \&to_string,
# spent 28µs making 1 call to overload::import
73233µs136µs 'fallback' => 1;
# spent 36µs making 1 call to MongoDB::OID::BEGIN@72
74
75
7612µs22.76ms__PACKAGE__->meta->make_immutable;
# spent 2.75ms making 1 call to Class::MOP::Class::make_immutable # spent 13µs making 1 call to MongoDB::OID::meta
77
7817µs1;
79
80__END__