WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@personalizedrefrigerator
Copy link
Collaborator

Summary

Adds a new debug benchmarkDeltaPerformance API to Joplin Server. Like the other debug API endpoints, benchmarkDeltaPerformance is only enabled in dev mode.

The benchmarkDeltaPerformance endpoint:

  1. Loops through all users.
  2. Measures how long models.change().delta takes to run for the current user.
  3. Repeats steps 1-2 several more times.
  4. Writes the results to a CSV file.

This is the API that was used to generate the tables in #13655 (comment).

Manual testing plan

  1. Run

    curl --data '{"action":"benchmarkDeltaPerformance"}' -H 'Content-Type: application/json' http://localhost:22300/api/debug
    
  2. Verify that packages/server/delta-perf.csv exists and has content similar to:

    user.id, share count, user item count, total item size, average delta time (ms)
    rm6pECHyFP206hIqqLYFcb,12208,37564,5044231,932.6840926999982
    dyg1imrqdlbzCx2VhIPvxi,12097,37678,5066994,1006.9090389999852
    6jXsuuLvkamu0MsVarv6tf,12166,37977,4984522,1046.4843974000019
    bYfMHaGNVIH5d7Nwx58GfE,12237,37738,5059262,1129.4750577000027
    18fQWEoZU4MPFJejfCgcef,12271,38059,4967876,933.2209174000076
    dBFPfBUYjHoddB9DzfOEw8,12363,38443,5086866,941.5754076999904
    1thkhvWwq1FgWlkN2WfHsm,12391,37941,5012717,1018.9216304999893
    155BdeCLPzNddRbvhXMI9H,12372,38094,5050532,894.4402346999966
    ivik7PUoVFlRLOmzWTnzxN,12221,37861,5167072,862.2404661000066
    jFl1PFAo3un3oUInH7n9wY,12240,38126,4968194,775.7858183999895
    f5Xb443bR0dtnYiL26WTY3,10,32,9830,40.194779000000565
    uemlqC6dzuIWNmT1bT4Dyg,15,67,21554,29.212947900028666
    FfUKuk3Q1OO5HO28MIH4dr,18,53,18590,41.03838019999093
    ewGrY66oMkVxKAMZR2irg8,21,41,13260,52.91299810000928
    D9GyBsyTWrCvqdigC1butS,14,65,20467,47.2022217000078
    uYGFhkyr5kggj8oKm1PNCa,16,60,19124,48.39116229997599
    DOH3iMW7uDSb9FH8jb0RlC,18,36,13866,60.30182369999238
    gRckvcTjTsTh6pcCLzqYXz,16,63,20686,40.83253420000547
    Ubyz2rOjTdHpjamX2SsKa0,17,68,21280,34.895353599998636
    ZkFrMT4VCliWn8erGvmyKv,21,55,18245,54.702609500009565
    z3eBQPIRrxLTapCyFCFbMX,0,0,0,16.536613000003854
    

@laurent22
Copy link
Owner

laurent22 commented Nov 29, 2025

Please could you add a documentation for it, with an explanation why and how it can be useful?

Edit: also please add to that same documentation information about this one: #13800

@personalizedrefrigerator
Copy link
Collaborator Author

Please could you add a documentation for it, with an explanation why and how it can be useful?

Good idea! Documentation has been added to server_debug.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants