Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\MessageLoading\SerializedMessageIndex Class Reference

Storage on serialized file. More...

Inheritance diagram for MediaWiki\Extension\Translate\MessageLoading\SerializedMessageIndex:
MediaWiki\Extension\Translate\MessageLoading\MessageIndexStore

Public Member Functions

 retrieve (bool $readLatest=false)
 
 store (array $array, array $diff)
 
- Public Member Functions inherited from MediaWiki\Extension\Translate\MessageLoading\MessageIndexStore
 get (string $key)
 
 getKeys ()
 

Additional Inherited Members

- Protected Member Functions inherited from MediaWiki\Extension\Translate\MessageLoading\MessageIndexStore
 serialize ( $data)
 These are probably slower than serialize and unserialize, but they are more space efficient because we only need strings and arrays.
 
 unserialize ( $data)
 

Detailed Description

Storage on serialized file.

This serializes the whole array. Because this format can preserve the values which are stored as references inside the array, this is the most space efficient storage method and fastest when you want the full index.

Unfortunately when the size of index grows to about 50000 items, even though it is only 3,5M on disk, it takes 35M when loaded into memory and the loading can take more than 0,5 seconds. Because usually we need to look up only few keys, it is better to use another backend which provides random access - this backend doesn't support that.

Definition at line 22 of file SerializedMessageIndex.php.

Member Function Documentation

◆ retrieve()

MediaWiki\Extension\Translate\MessageLoading\SerializedMessageIndex::retrieve ( bool $readLatest = false)

◆ store()

MediaWiki\Extension\Translate\MessageLoading\SerializedMessageIndex::store ( array $array,
array $diff )

The documentation for this class was generated from the following file: