Dear Nimmers,
[Here's](https://github.com/LemonBoy/criterion.nim) a nice little library for
all your microbenchmarking needs. Benchmarking is hard and the aim of this
library is to abstract away most of the complexity and pitfalls and provide the
user (hopefully) meaningful results. I
That's now fixed! Thanks for the heads up!
> I have no idea how he gets the exact cycle count
By using the rdtsc instruction on x86/x64 CPUs (see
[here](https://www.felixcloutier.com/x86/RDTSC.html) for more details). If
you're looking for benchmarking solutions check out
[this](https://github.com/LemonBoy/criterion.nim) lib too :)
I've just finished implementing it (at least for x64) :)
> The example output on your github page is still wrong, the cycles count is
> much too high.
Is it? I've probably benchmarked it without the release switch.
As usual beware of the optimizer, make sure the benchmark function doesn't
elide the comparison completely. Introducing an argument using
Oh I see what you mean. As usual one must be smart enough to set the CPU
governor to 'performance' and pin the benchmarking thread to a single core to
prevent measuring errors due to SMP migration.
Benchmarking is twice as hard as writing code :)
If the size is known at compile time you may make size a static[int] parameter
for the object. Otherwise you should drop the array altogether and use a
preallocated seq.
Since the size is part of the type you can easily extract it with this
completely untested piece of code that should hopefully work:
proc size1[N](x: Object[N]): int = N
Run
Thanks for the report, I've pushed a fix
[here](https://github.com/nim-lang/Nim/pull/8977). Please checks if it solves
the problem for you.
seful for
serialization-heavy workflows.
You can grab it [here](https://github.com/LemonBoy/dtoa.nim).
The underlying algorithm is nothing more than `grisu2` that's going to give you
roundtrip-able values in the shortest amount of time, the tradeoff is in the
0.05% of numbers that cannot be "encoded" in the shortest possible way.
For a stdlib implementation you may want to use something like `err
Good news, criterion is now available on nimble!
I also need your help, if you're on Windows or OSX can you please check if the
`tfib.nim` example runs fine for you? I tried setting up Travis to run the test
suite on OSX too but got a timeout after 10m so either the timing code is wrong
for tha
2 minutes top on a very busy machine. I guess there's something wrong in the
`getMonotonicTime` implementation for OSX then... What is the computed
`scaleFactor` in `timer.nim` ?
Thanks to @dm1try latest PR it now works fine on OSX!
Hello people, I've just released **cassette** in its initial form, you can find
it [here](https://github.com/LemonBoy/cassette).
This library lets you record & replay your HTTP interactions with a remote
server and is really useful if you want to make your tests deterministic (and
fa
First things first, I'm able to run your program without `--opt:size` after
some minor modifications.
You're building a `wxListItem` incorrectly since you specify too few masks and
the width and format you specify are ignored: see
[here](https://github.com/wxWidgets/wxWidgets/blob/cc931612eec2e
It's not a bug, it's a feature :) You probably missed
[this](https://nim-lang.github.io/Nim/manual.html#closures-creating-closures-in-loops)
part of the manual where it is explained that closures capture variable by
reference. In your example the inner `serve` captures `c` by reference and, as
Easy as cake
type
UDP_packet = object
port_src: uint16
port_dst: uint16
length: uint16
chksum: uint16
data: UncheckedArray[byte]
Run
> It won't print nicely though
Yeah, the compiler-generated `$`
18 matches
Mail list logo