ffi-overhead icon indicating copy to clipboard operation
ffi-overhead copied to clipboard

update v

Open ken0x0a opened this issue 3 years ago • 4 comments

debug build is slow

ken0x0a avatar Aug 28 '21 06:08 ken0x0a

And also, if we want to check ffi overhead, I think we need to update v file to

#flag ./newplus/plus.o
#include "./newplus/plus.h"

instead of

#include "newplus/plus.c"

ken0x0a avatar Aug 28 '21 06:08 ken0x0a

my change result in 0ms

ken0x0a avatar Aug 28 '21 06:08 ken0x0a

my change result in 0ms

That sounds a little too fast. Is V optimizing away the for x < count { x = C.plusone(x) } loop? Could you double check the generated code with the prod flag?

And also, if we want to check ffi overhead, I think we need to update v file to ... instead of ...

I'm not understanding why, mind schooling me on this one?

Thanks in advance, @ken0x0a.

minond avatar Aug 30 '21 17:08 minond

@minond As I understand correctly, this repo is about ffi overhead. By using #include "newplus/plus.c" there should "not" be any overhead as ".v" file is translated into ".c" and compiled after that.

If I change v file to

#flag ./newplus/plus.o
#include "./newplus/plus.h"

instead of

#include "newplus/plus.c"

then, I got same overhead with "C".

And also, I forgot to mention that I don't understand (can't write) "C".

ken0x0a avatar Aug 30 '21 22:08 ken0x0a

@ken0x0a I would keep this open as it is still unsolved. WDYT?

dumblob avatar Jul 11 '23 07:07 dumblob

@dumblob That's true. Good to use -prod. That's fair.

And also think, the results on the README file will change a lot if we use LTO.

ken0x0a avatar Jul 11 '23 08:07 ken0x0a

@minond Can you merge this?

ken0x0a avatar Jul 11 '23 08:07 ken0x0a

@minond Can you merge this?

@ken0x0a I don't have merging privileges for this repo, I'd ping @dyu.

minond avatar Jul 11 '23 22:07 minond