openresty / openresty/luajit2

lj_str_new and lj_tab hashkey CPU 100%

Open
#158 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
1.4k
Forks
252
Avg merge
7d 11h
Merged PRs (30d)
3

Description

lj_str_new CPU 100% only in one core
8822e63e0876e34cc52f2431ad8318b

large number of strings longer than 128 in the mlcache cache. biz logic necessity

Flame Graph:

image

Perf Data:
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f9086d786f9 in lj_str_new (L=0x53f113f0, str=0x40926ae0 "{"event":"mlcache:invalidations:_cache","source":"mlcache","data":"AUTH_OUTER_VER_KEY_X4eTEiMr-jLHD5z0VzzRPFLPOtKLwgLKQXq-TAFyOjl8vv5u2Cn2uQPthlHjlqhr11y4ZioD6L","pid":12861}e\":\"bearer\",\"exp"..., lenx=180) at lj_str.c:198
198 lj_str.c:

企业微信截图_16530919403452
https://github.com/openresty/luajit2/blob/v2.1-agentzh/src/lj_str.c

image

Related issue:
https://github.com/openresty/luajit2/issues/60

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/lj_str.c at lj_str_new, especially line 198, and review the supplied flame graph and perf data. Compare the behavior with related issue #60; the issue does not define a specific fix or completion test, so confirm the intended resolution with maintainers before proceeding.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.