in reply to Re: Adjusting variable context when working with JSON data?
in thread Adjusting variable context when workign with JSON data?
Oops, I think I accidentally removed that closing curly brace for the loop there. I originally posted the without using any HTML tags and went back to adjust the post manually... got a little too carried away.
You are probably right, spawning new processes is always expensive, and making this only once shows that Perl runs much faster. I would like to play with hyperfine as suggested above, so I might try that when I have something a bit more meaningful to test on.
The "benchmark" was just for fun, thought, to see how Python and Perl compare. What I'm more concerned is with the correctness of the script, specifically how the JSON is processed. As I said, I find this syntax a bit strange: (@$decoded). I couldn't figure it out without looking for answers online and I'm not sure if there's perhaps a better way to tell Perl that this is an array (assuming that I know in advance the structure of the JSON to be returned)?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Adjusting variable context when working with JSON data?
by choroba (Cardinal) on Dec 03, 2024 at 21:38 UTC | |
by unmatched (Sexton) on Dec 04, 2024 at 17:24 UTC | |
|
Re^3: Adjusting variable context when working with JSON data?
by Danny (Chaplain) on Dec 05, 2024 at 00:57 UTC | |
by unmatched (Sexton) on Dec 08, 2024 at 10:52 UTC | |
by hippo (Archbishop) on Dec 08, 2024 at 11:32 UTC | |
by unmatched (Sexton) on Dec 09, 2024 at 10:56 UTC | |
by marinersk (Priest) on Dec 10, 2024 at 07:31 UTC |