Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/17/11 10:59:06 (13 years ago)
Author:
epitzer
Message:

Use an asynchronous buffer to allow parallel execution of zip (de)compression and (de)serialization (#1530)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceSpeedUp/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs

    r5445 r6211  
    7575        try {
    7676          iterator = handlers[reader.Name].Invoke();
    77         }
    78         catch (KeyNotFoundException) {
     77        } catch (KeyNotFoundException) {
    7978          throw new PersistenceException(String.Format(
    8079            "Invalid XML tag \"{0}\" in persistence file.",
     
    176175        }
    177176        return typeCache;
    178       }
    179       catch (PersistenceException) {
     177      } catch (PersistenceException) {
    180178        throw;
    181       }
    182       catch (Exception e) {
     179      } catch (Exception e) {
    183180        throw new PersistenceException("Unexpected exception during type cache parsing.", e);
    184181      }
     
    196193          return Deserialize(file);
    197194        }
    198       }
    199       finally {
     195      } finally {
    200196        TimeSpan end = System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;
    201197        Tracing.Logger.Info(string.Format(
     
    226222          XmlParser parser = new XmlParser(reader);
    227223          Deserializer deserializer = new Deserializer(new TypeMapping[] { });
    228           return deserializer.Deserialize(parser);
    229         }
    230       }
    231       catch (PersistenceException) {
     224          return deserializer.Deserialize(new AsyncBuffer<ISerializationToken>(parser));
     225        }
     226      } catch (PersistenceException) {
    232227        throw;
    233       }
    234       catch (Exception x) {
     228      } catch (Exception x) {
    235229        throw new PersistenceException("Unexpected exception during deserialization", x);
    236230      }
     
    258252        XmlParser parser = new XmlParser(
    259253          new StreamReader(zipFile.GetInputStream(data)));
    260         object result = deSerializer.Deserialize(parser);
     254        object result = deSerializer.Deserialize(new AsyncBuffer<ISerializationToken>(parser));
    261255        zipFile.Close();
    262256        return result;
    263       }
    264       catch (PersistenceException) {
     257      } catch (PersistenceException) {
    265258        throw;
    266       }
    267       catch (Exception e) {
     259      } catch (Exception e) {
    268260        throw new PersistenceException("Unexpected exception during deserialization", e);
    269261      }
Note: See TracChangeset for help on using the changeset viewer.