Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i3-7130U: AEGIS-128X2 25% slower than AEGIS-128L #16

Open
rfjakob opened this issue Mar 2, 2025 · 1 comment
Open

i3-7130U: AEGIS-128X2 25% slower than AEGIS-128L #16

rfjakob opened this issue Mar 2, 2025 · 1 comment

Comments

@rfjakob
Copy link

rfjakob commented Mar 2, 2025

This is a laptop with an i3-7130U, which, acc. to both the intel specs and /proc/cpuinfo, has AVX2.

So I would expect AEGIS-128X2 to be faster than AEGIS-128L.

But it's actually 25% slower (see below). Is this expected?

0 jakob@dell19 ~/code/libaegis/zig-out/bin $ git describe
0.4.0-1-g146429f

0 jakob@dell19 ~/code/libaegis/zig-out/bin $ ./benchmark 
AEGIS-256	  43734.10 Mb/s
AEGIS-256X2	  53347.55 Mb/s
AEGIS-256X4	  35720.67 Mb/s
AEGIS-128L	  81207.08 Mb/s
AEGIS-128X2	  60710.76 Mb/s
AEGIS-128X4	  42029.63 Mb/s
AEGIS-128L MAC	  83278.31 Mb/s
AEGIS-128X2 MAC	  78842.34 Mb/s
AEGIS-128X4 MAC	  71318.39 Mb/s
AEGIS-256 MAC	  45403.57 Mb/s
AEGIS-256X2 MAC	  53503.39 Mb/s
AEGIS-256X4 MAC	  50475.93 Mb/s
cat /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 142
model name	: Intel(R) Core(TM) i3-7130U CPU @ 2.70GHz
stepping	: 9
microcode	: 0xf6
cpu MHz		: 2700.014
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb pti ssbd ibrs ibpb stibp tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm arat pln pts hwp hwp_notify hwp_act_window hwp_epp vnmi md_clear flush_l1d arch_capabilities
vmx flags	: vnmi preemption_timer invvpid ept_x_only ept_ad ept_1gb flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest ple pml ept_violation_ve ept_mode_based_exec
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds mmio_stale_data retbleed gds
bogomips	: 5399.81
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

Relates-to: rfjakob/gocryptfs#900

@rfjakob rfjakob changed the title i3-7130U: AEGIS-128X2 slower than AEGIS-128L i3-7130U: AEGIS-128X2 25% slower than AEGIS-128L Mar 2, 2025
@jedisct1
Copy link
Collaborator

jedisct1 commented Mar 2, 2025

That CPU supports AVX2 but lacks the VAES extensions, which are also required to fully leverage X2 on Intel CPUs.

There is a way to minimize X2's overhead on CPUs that lack the necessary parallelism. This optimization has not yet been implemented in libaegis, but it will be in the future. From an application perspective, no changes will be required to benefit from it—simply updating the library will suffice.

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

No branches or pull requests

2 participants