Skip to content

Instantly share code, notes, and snippets.

@mitsuhiko
Created August 4, 2012 12:41
Show Gist options
  • Save mitsuhiko/3257380 to your computer and use it in GitHub Desktop.
Save mitsuhiko/3257380 to your computer and use it in GitHub Desktop.
mitsuhiko at atherton in ~ exited 2 on git:master? workon fireteam-sandbox
$ python -mtimeit -s 'from marshal import dumps, loads; x = [[1, 2, 3], [4, 5, 6]]' 'loads(dumps(x))'
1000000 loops, best of 3: 1.16 usec per loop
mitsuhiko at atherton in ~ on git:master? workon fireteam-sandbox
$ python -mtimeit -s 'from copy import deepcopy; x = [[1, 2, 3], [4, 5, 6]]' 'deepcopy(x)'
10000 loops, best of 3: 20 usec per loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment