Skip to content

Looking for faster refresh speeds #99

Description

@rod7760

Hi all,

I'm currently working on adding support for another RTOS in this plugin. One thing that has been bothering me is I feel like refreshes could be faster. I attached an example of the refresh on threadx. However, I've noticed with a large amounts of processes, the refresh can get very slow. (I observed this in another RTOS, but I am using ThreadX for discussion. The ThreadX implementation is very similar to my WIP)

   public refresh(frameId: number): Promise<void> {
           ...
           section(this.threadCreatedCount, (n) => this.getThreadInfo(n, frameId), 'threads'),
            section(this.semaphoreCreatedCount, (n) => this.getSemaphoreInfo(n, frameId), 'semaphores'),
            section(this.mutexCreatedCount, (n) => this.getMutexInfo(n, frameId), 'mutexes'),
            section(this.bytePoolCreatedCount, (n) => this.getBytePoolInfo(n, frameId), 'byte pools'),
            ...
}

The implementation essentially loops through all the threads, sempahores, pools, etc. and creates typescript objects out of them.

 private async getThreadInfo(numThreads: number, frameId: number): Promise<void> {
        const threads: RTOSCommon.RTOSThreadInfo[] = [];

        const current = (await this.getExprVal('_tx_thread_current_ptr', frameId)) ?? undefined;
        let address = (await this.getExprVal('_tx_thread_created_ptr', frameId)) ?? '';

        let thread: RTOSCommon.RTOSStrToValueMap | undefined = await this.getExprValChildrenObj(
            '_tx_thread_created_ptr',
            frameId,
        );

        for (let i = 0; i < numThreads && thread !== undefined; i++) {
            const name = this.stringFromCharPointer(thread['tx_thread_name']?.val);
            ...

If you have any ideas and thoughts on this, I would love to hear them.

reload-threadx.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions