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

wikimedia / mediawiki-extensions-SemanticMediaWiki / 159
28%

Build:
DEFAULT BRANCH: master
Ran 17 Aug 2013 05:08AM UTC
Jobs 4
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

pending completion
159

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%)

5.67 hits per line

Jobs
ID Job ID Ran Files Coverage
1 159.1 (DBTYPE=mysql) 17 Aug 2013 05:02AM UTC 0
16.71
Travis Job 159.1
2 159.2 (DBTYPE=mysql) 17 Aug 2013 05:02AM UTC 0
16.71
Travis Job 159.2
3 159.3 (DBTYPE=sqlite) 17 Aug 2013 05:02AM UTC 0
16.71
Travis Job 159.3
4 159.4 (DBTYPE=sqlite) 17 Aug 2013 05:02AM UTC 0
16.71
Travis Job 159.4
Source Files on build 159
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #159
  • f22e79dd on github
  • Prev Build on master (#158)
  • Next Build on master (#160)
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