in reply to How do I unpack Perl floats in C
Are you sure the unpack is the bottleneck?
Running the following snippet on my pretty average hardware does around 800_000 unpacks per second.
my $buf = pack "FFFFL", (0.1) x 4, 999; for (1..1000_000) { my @row = unpack "FFFFL", $buf; } __END__ $ time ./836298.pl real 0m1.286s user 0m1.280s sys 0m0.004s
I'd wager an XS routine doing the same wouldn't really be a lot faster...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I unpack Perl floats in C
by Anonymous Monk on Apr 22, 2010 at 18:58 UTC | |
by ikegami (Patriarch) on Apr 22, 2010 at 19:30 UTC |