Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #85170
| Date | 2015-02-03 16:00 -0500 |
|---|---|
| From | Dave Angel <davea@davea.name> |
| Subject | Re: Benchmarking some modules - strange result |
| References | <CAGGBd_rSazrC4yAt+CebeuvCJYjZWOXohoZHgTUtfGNZZtr5Ww@mail.gmail.com> <CAPTjJmr+9heLd44Ly=5oKrMcGBdBhWuDxmi_n1+izg=TxTB=sg@mail.gmail.com> <CAGGBd_q33YGH9ZwOv4oTE6LERxbf55HyOM07TpWznjMumz1yKw@mail.gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.18440.1422997212.18130.python-list@python.org> (permalink) |
On 01/24/2015 09:36 PM, Dan Stromberg wrote: > On Sat, Jan 24, 2015 at 6:24 PM, Chris Angelico <rosuav@gmail.com> wrote: >> On Sun, Jan 25, 2015 at 1:11 PM, Dan Stromberg <drsalists@gmail.com> wrote: >>> For simplicity, let's say I've been running the suite of performance >>> tests within a single interpreter - so I test one module thoroughly, >>> then move on to the next without exiting the interpreter. >>> [chomp more details] >> >> Do the modules import stuff that's staying imported? That could >> majorly affect performance. What about .pyc files? > > The modules are all imported up at the top of the script. I haven't > verified this, but I'm guessing the .pyc's are created at the > beginning too. > >> I don't know if you can truly reset the interpreter. Snapshotting >> sys.modules and reinstating it afterwards would help, but there are >> other concerns too. I would personally just restart the interpreter >> each time, frankly; it's the easiest way to be sure. > > Maybe so ^_^ > I've been offline for two weeks, so sorry about the delay in responding. There are many pieces of the Python system that do not reset. But just because the C memory allocation routines do not reset to their initial state, running the gc between runs is not sufficient to normalize things. I believe you MUST restart the interpreter between runs. Further, the OS buffer system and the paging system are not going to be in the same state between runs. years ago I knew how to clear those buffers in Windows, but I've never needed to look it up for Linux. in Windows, I'd look first at one of the sysinternalstools, such as https://technet.microsoft.com/en-us/sysinternals/ff700229 On Linux, i'd look at the following utilities, swapon/swapoff, and at file /proc/sys/vm/drop_caches and maybe see website: https://code.google.com/p/linux-ftools/ -- DaveA
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Benchmarking some modules - strange result Dave Angel <davea@davea.name> - 2015-02-03 16:00 -0500
csiph-web