• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wikimedia / mediawiki-extensions-SemanticMediaWiki / 159 / 4
28%
master: 28%

Build:
DEFAULT BRANCH: master
Ran 17 Aug 2013 05:08AM UTC
Files 199
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Aug 2013 05:08AM UTC coverage: 16.71% (+0.1%) from 16.597%
DBTYPE=sqlite

push

travis-ci

mwjames
\SMW\ObjectStorage, \SMW\SimpleDictionary, \SMW\ObjectDictionary

Introduces a simpler implementation of a dictionary and object storage
compared with the ArrayObject.

\SMW\ObjectStorage
Code coverage: 100%
CRAP: 6

\SMW\SimpleDictionary
Code coverage: 100%
CRAP: 10

## Usage
$dictionary = new SimpleDictionary( array( 'Foo' => 'Bar' ) );

$dictionary->has( 'Foo' ) returns true
$dictionary->get( 'Foo' ) returns 'Bar'
$dictionary->set( 'Foo', array( 'Lula', 'Bar') )
$dictionary->remove( 'Foo' )

## Runtime analysis

N-Array -> Array -> $s[] = array( "name" => "Adam", "age" => 35 );
H-Array -> SimpleDictionary -> $h->set( "name", "Adam" )->set( "age", 35 ); $s[] = $h->toArray();
O-Array -> ArrayObject -> $o->offsetSet( "name", "Adam" ); $o->offsetSet( "age", 35 ); $s[] = $o->getArrayCopy();

for( $x = 0; $x < 1; $x++ )
1) SMW\Test\SimpleDictionaryTest::testRuntimeComparison
This test printed output:
N-Array, Memory: 7856168 Execution time: 4.2915344238281E-5
H-Array, Memory: 7856168 Execution time: 0.00015687942504883
O-Array, Memory: 7856168 Execution time: 0.0001060962677002

for( $x = 0; $x < 100; $x++ )
1) SMW\Test\SimpleDictionaryTest::testRuntimeComparison
This test printed output:
N-Array, Memory: 7859744 Execution time: 0.00049209594726562
H-Array, Memory: 7859912 Execution time: 0.0050039291381836
O-Array, Memory: 7860184 Execution time: 0.0040531158447266

for( $x = 0; $x < 10000; $x++ )
1) SMW\Test\SimpleDictionaryTest::testRuntimeComparison
This test printed output:
N-Array, Memory: 11401200 Execution time: 0.054563999176025
H-Array, Memory: 11401632 Execution time: 0.56676602363586
O-Array, Memory: 11402272 Execution time: 0.41397500038147

For a large set of continues iterations, the native ArrayObject
implementation has an advantage over the SimpleDictionary implementation.

Change-Id: I8d8336f96

2437 of 14584 relevant lines covered (16.71%)

1.42 hits per line

Source Files on job 159.4 (DBTYPE=sqlite)
  • Tree
  • List 0
  • Changed 9
  • Source Changed 8
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 159
  • Travis Job 159.4
  • f22e79dd on github
  • Prev Job for DBTYPE=sqlite on master (#158.3)
  • Next Job for DBTYPE=sqlite on master (#160.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc