且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Windows上,试用版代码以32位运行的速度比Linux上64位的运行速度快两倍

更新时间:2023-02-06 21:43:11

您没有说Windows / Linux操作系统是32位还是64位。

You don't say whether the windows/linux operating systems are 32 or 64 bit.

在64位linux机器上,如果将size_t更改为int,您会发现linux的执行时间下降到与您拥有的执行时间相似的值

On a 64-bit linux machine, if you change the size_t to an int you'll find that execution times drop on linux to a similar value to those that you have for windows.

size_t在win32上是int32,在win64上是int64。

size_t is an int32 on win32, an int64 on win64.

编辑:刚刚看到了Windows反汇编。

just seen your windows disassembly.

您的Windows操作系统是32位版本(或者至少您已编译为32位)。

Your windows OS is the 32-bit variety (or at least you've compiled for 32-bit).