Interface InfiniteCachePerformanceInterface

The InfiniteCachePerformanceInterface interface is used to control the resources allocated to the cache.

A physical cache (based on IndexedDB) is used to store build infos (used to initialize the renderer), and a second cache to store HD geometries. Changing values for the performance object may store the new initialization parameters in the localStorage of the browser, thus allowing the user to set specific information for its hardware.

/** 
* Sample to illustrate the use of modifying the cache (InfiniteCacheInterface, PerformanceInterface) settings.
*/
import { InfiniteCacheInterface, InfiniteCachePerformanceInterface } from 'generated_files/documentation/appinfiniteapi';

// created previously
let lCache : InfiniteCacheInterface;
// get the performance interface
const lPerformanceInfos : InfiniteCachePerformanceInterface = lCache.getPerformance();
// the cache sizes to modify
// 1GB for build data
const lMaxBuildCacheSize : number = 1 * 1024 * 1024 * 1024;
// 1GB for HD geometry data
const lMaxGeometryCacheSize : number = 1 * 1024 * 1024;

console.assert(lPerformanceInfos.getMaxBuildCacheSize() === lCache.getMaxBuildSize());
console.assert(lPerformanceInfos.getMaxGeometryCacheSize() === lCache.getMaxHDSize());

console.assert(lPerformanceInfos.getCurrentBuildCacheSize() === lCache.getCurrentBuildSize());
console.assert(lPerformanceInfos.getCurrentGeometryCacheSize() === lCache.getCurrentHDSize());

lPerformanceInfos.setMaxBuildCacheSize(lMaxBuildCacheSize);
lPerformanceInfos.setMaxGeometryCacheSize(lMaxGeometryCacheSize);

Setters all feature a `pSetAsDefaultInit` parameter that tells if the value must be set in the localStorage, thus leading to using this values for subsequent object creations.
3D Rendering

interface InfiniteCachePerformanceInterface {
    GetMaxBuildCacheSizeDefault(): number;
    GetMaxBuildCacheSizeInit(): number;
    GetMaxBuildCacheSizeMin(): number;
    GetMaxGeometryCacheSizeDefault(): number;
    GetMaxGeometryCacheSizeInit(): number;
    GetMaxGeometryCacheSizeMin(): number;
    getCurrentBuildCacheSize(): number;
    getCurrentGeometryCacheSize(): number;
    getMaxBuildCacheSize(): number;
    getMaxGeometryCacheSize(): number;
    resetDefaultValues(pSetAsDefaultInit?): boolean;
    setMaxBuildCacheSize(pMaxBytesCount, pSetAsDefaultInit?): boolean;
    setMaxGeometryCacheSize(pMaxBytesCount, pSetAsDefaultInit?): boolean;
}

Methods

  • Gets the default (initialization) maximum amount of disk usage used to store build data in the cache (in bytes).

    This value is a constant, arbitrary set by the library 4 GB.

    Returns number

    The default maximum number of bytes used to store build data.

  • Gets the current (initialization) maximum amount of disk usage used to store build data in the cache (in bytes).

    Returns number

    The current maximum number of bytes used to store build data set at initialization.

  • Gets the minimal amount of disk usage used to store build data in the cache that can be set by setMaxBuildCacheSize (in bytes).

    This value is a constant, arbitrary set by the library 128 MB.

    Returns number

    The minimum value that can be set by setMaxBuildCacheSize.

  • Gets the default (initialization) maximum amount of disk usage used to store high definition geometries in the cache (in bytes).

    This value is a constant, arbitrary set by the library 4 GB.

    Returns number

    The default maximum number of bytes used to store HD geometries.

  • Gets the current (initialization) maximum amount of disk usage used to store high definition geometries in the cache (in bytes).

    Returns number

    The current maximum number of bytes used to store HD geometries set at initialization.

  • Gets the minimal amount of disk usage used to store high definition geometries in the cache that can be set by setMaxGeometryCacheSize (in bytes).

    This value is a constant, arbitrary set by the library 128 MB.

    Returns number

    The minimum value that can be set by setMaxGeometryCacheSize.

  • Gets the current amount of disk usage used to store build data in the cache (in bytes).

    Caching such data helps starting the application much faster. This value is shared between all the builds that may have been opened by the user.

    Returns number

    The current number of bytes used to cache build information.

  • Gets the current amount of disk usage used to store high definition geometries in the cache (in bytes).

    Caching such data helps lowering the bandwidth usage. This value is shared between all the projects that may have been opened by the user.

    Returns number

    The current number of bytes used to cache HD geometries.

  • Gets the maximum amount of disk usage used to store build data in the cache (in bytes).

    Caching such data helps starting the application much faster. This value is shared between all the builds that may have been opened by the user.

    This value defaults to 4 GB.

    Returns number

    The maximum number of bytes used to cache build information.

  • Gets the maximum amount of disk usage used to store high definition geometries in the cache (in bytes).

    Caching such data helps lowering the bandwidth usage. This value is shared between all the projects that may have been opened by the user.

    This value defaults to 4 GB.

    Returns number

    The maximum number of bytes used to cache HD geometries.

  • Resets the cache to its default values.

    Parameters

    • Optional pSetAsDefaultInit: boolean
      in
      if set and true, then the default values will be also used as initialization values.

    Returns boolean

    true if the default values were reset.

  • Sets the maximum amount of disk usage used to store build data in the cache (in bytes).

    Caching such data helps starting the application much faster. This value is shared between all the builds that may have been opened by the user.

    This value defaults to 4 GB.

    Parameters

    • pMaxBytesCount: number
      in
      The new maximum number of bytes used to cache build information.
    • Optional pSetAsDefaultInit: boolean
      in
      if set and true, then the given value is also used as default initialization value.

    Returns boolean

    true if the value is superior to GetMaxBuildCacheSizeMin.

  • Sets the maximum amount of disk usage used to store high definition geometries in the cache (in bytes).

    Caching such data helps lowering the bandwidth usage. This value is shared between all the projects that may have been opened by the user.

    This value defaults to 4 GB.

    Parameters

    • pMaxBytesCount: number
      in
      The new maximum number of bytes used to cache HD geometries.
    • Optional pSetAsDefaultInit: boolean
      in
      if set and true, then the given value is also used as default initialization value.

    Returns boolean

    true if the value is superior to GetMaxGeometryCacheSizeMin.