Skip to content

[DYNAREC][ENV] Disabled SEP by default - #4045

Merged
ptitSeb merged 3 commits into
ptitSeb:mainfrom
ksco:disable-sep
Jul 15, 2026
Merged

[DYNAREC][ENV] Disabled SEP by default#4045
ptitSeb merged 3 commits into
ptitSeb:mainfrom
ksco:disable-sep

Conversation

@ksco

@ksco ksco commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Now that we have callret enabled by default, I noticed SEP causes the branch misprediction by an order of magnitude in coremark, while the memory-saving effect is almost imperceptible.

ksco@steel [ coremark@main ] $ BOX64_LOG=0 BOX64_NOBANNER=1 BOX64_DYNACACHE=0 BOX64_DYNAREC_SEP=0 perf stat -e task-clock,cycles,instructions,branches,branch-misses -- taskset -c 2 box64 ./coremark.exe_x64 0 0 0x66 200000 7 1 >/dev/null

 Performance counter stats for 'taskset -c 2 box64 ./coremark.exe_x64 0 0 0x66 200000 7 1':

         16,339.65 msec task-clock:u
    35,828,022,082      cycles:u
   118,528,644,489      instructions:u
    12,994,274,457      branches:u
        36,068,961      branch-misses:u

      16.348269274 seconds time elapsed

      16.331188000 seconds user
       0.009995000 seconds sys

ksco@steel [ coremark@main ] $ BOX64_LOG=0 BOX64_NOBANNER=1 BOX64_DYNACACHE=0 BOX64_DYNAREC_SEP=1 perf stat -e task-clock,cycles,instructions,branches,branch-misses -- taskset -c 2 box64 ./coremark.exe_x64 0 0 0x66 200000 7 1 >/dev/null

 Performance counter stats for 'taskset -c 2 box64 ./coremark.exe_x64 0 0 0x66 200000 7 1':

         18,571.57 msec task-clock:u
    40,721,222,650      cycles:u
   118,523,943,716      instructions:u
    12,993,208,645      branches:u
       383,363,320      branch-misses:u

      18.581470637 seconds time elapsed

      18.564061000 seconds user
       0.008996000 seconds sys

ksco@steel [ coremark@main ] $ perf stat -e task-clock,cycles,instructions,branches,branch-misses -- taskset -c 2 ./coremark.exe 0 0 0x66 200000 7 1 >/dev/null

 Performance counter stats for 'taskset -c 2 ./coremark.exe 0 0 0x66 200000 7 1':

          9,757.79 msec task-clock:u
    21,407,080,976      cycles:u
    62,785,977,365      instructions:u
    11,852,476,157      branches:u
        18,851,352      branch-misses:u

       9.762550998 seconds time elapsed

       9.757495000 seconds user
       0.000999000 seconds sys

ksco added 2 commits July 15, 2026 17:46
Now that we have callret enabled by default, I noticed SEP causes the branch misprediction by an order of magnitude in coremark, while the memory-saving effect is almost imperceptible.

```
ksco@steel [ coremark@main ] $ BOX64_LOG=0 BOX64_NOBANNER=1 BOX64_DYNACACHE=0 BOX64_DYNAREC_SEP=0 perf stat -e task-clock,cycles,instructions,branches,branch-misses -- taskset -c 2 box64 ./coremark.exe_x64 0 0 0x66 200000 7 1 >/dev/null

 Performance counter stats for 'taskset -c 2 box64 ./coremark.exe_x64 0 0 0x66 200000 7 1':

         16,339.65 msec task-clock:u
    35,828,022,082      cycles:u
   118,528,644,489      instructions:u
    12,994,274,457      branches:u
        36,068,961      branch-misses:u

      16.348269274 seconds time elapsed

      16.331188000 seconds user
       0.009995000 seconds sys

ksco@steel [ coremark@main ] $ BOX64_LOG=0 BOX64_NOBANNER=1 BOX64_DYNACACHE=0 BOX64_DYNAREC_SEP=1 perf stat -e task-clock,cycles,instructions,branches,branch-misses -- taskset -c 2 box64 ./coremark.exe_x64 0 0 0x66 200000 7 1 >/dev/null

 Performance counter stats for 'taskset -c 2 box64 ./coremark.exe_x64 0 0 0x66 200000 7 1':

         18,571.57 msec task-clock:u
    40,721,222,650      cycles:u
   118,523,943,716      instructions:u
    12,993,208,645      branches:u
       383,363,320      branch-misses:u

      18.581470637 seconds time elapsed

      18.564061000 seconds user
       0.008996000 seconds sys

ksco@steel [ coremark@main ] $ perf stat -e task-clock,cycles,instructions,branches,branch-misses -- taskset -c 2 ./coremark.exe 0 0 0x66 200000 7 1 >/dev/null

 Performance counter stats for 'taskset -c 2 ./coremark.exe 0 0 0x66 200000 7 1':

          9,757.79 msec task-clock:u
    21,407,080,976      cycles:u
    62,785,977,365      instructions:u
    11,852,476,157      branches:u
        18,851,352      branch-misses:u

       9.762550998 seconds time elapsed

       9.757495000 seconds user
       0.000999000 seconds sys

```
@ptitSeb

ptitSeb commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Are you sure about the memory saving being minimmum? (how about it's enable by default on SAVE_MEM configuration?)

@ksco

ksco commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Are you sure about the memory saving being minimmum? (how about it's enable by default on SAVE_MEM configuration?)

Do you have any workload where SEP reduces memory consumption noticeably? Because I can't find one.

@ksco

ksco commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Anyway, I think "enable by default on SAVE_MEM" is a good idea indeed.

@ksco

ksco commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Done

@ptitSeb
ptitSeb merged commit 894a183 into ptitSeb:main Jul 15, 2026
28 checks passed
@ksco
ksco deleted the disable-sep branch July 15, 2026 12:13
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