qb-core icon indicating copy to clipboard operation
qb-core copied to clipboard

Cache common Identifiers for faster access

Open JericoFX opened this issue 9 months ago • 2 comments

Description

Cache the most common Identifiers so can be access more faster without for loops

Checklist

  • [ ] I have personally loaded this code into an updated qbcore project and checked all of its functionality.
  • [X ] My code fits the style guidelines.
  • [X ] My PR fits the contribution guidelines.

JericoFX avatar Feb 27 '25 00:02 JericoFX

Hmm, so I benchmarked these and it only seemed marginally faster in some areas, and sometimes the benchmark would come out as slower. Could you possibly provide some benchmarks on your end? I also wonder whether it'd be quicker under load, since I only tested this in a dev server.

Before:

(Citizen ID) AVG Benchmark Results: 0.25904   ms      for     50      iterations

(License) AVG Benchmark Results: 0.29025   ms      for     50      iterations

(Phone) AVG Benchmark Results: 0.26174   ms      for     50      iterations

(Account) AVG Benchmark Results: 0.30763   ms      for     50      iterations

After:

(Citizen ID) AVG Benchmark Results: 0.21844   ms      for     50      iterations

(License) AVG Benchmark Results: 0.32354   ms      for     50      iterations

(Phone) AVG Benchmark Results: 0.21656   ms      for     50      iterations

(Account) AVG Benchmark Results: 0.28152   ms      for     50      iterations

Qwerty1Verified avatar Apr 13 '25 18:04 Qwerty1Verified

This PR has had 60 days of inactivity & will close within 7 days

github-actions[bot] avatar Jun 13 '25 15:06 github-actions[bot]