title: Profiling, detecting, and improving assignment performance?
body: <p>I need to profile a script file. I decorated the function in question with <code>@profile</code> and used <code>kernprof.py -l -v scriptfile.py</code> to run the profiler, which gave me the stats listed below:</p>
  
  <p>The assignment <code>_dict[date_kw][objekt_id]['subs_kaa']=item[kaa_subs]</code> takes 2.1µs, but is called about 8 million times (which is a fraction only and end ups with about 64 million) and the script has more of those assignments. </p>
  
  <p>The target structure is a <code>dict(dict(dict(interger)))</code>. </p>
  
  <p>Is there any option to speed this up, i.e. by copying the value differently?</p>
  
  <pre><code>Line# Hits    TimePerHit % Time Line Contents
  108   7977576 16362872   2.1    6.3  _dict[date_kw][objekt_id]['subs_kaa']=item[kaa_subs]
  109   7977576 16251240   2.0    6.3  _dict[date_kw][objekt_id]['subs_kad']=item[kad_subs]
  110   7977576 15967840   2.0    6.1  _dict[date_kw][objekt_id]['subs_kip']=item[kip_subs]
  </code></pre>