Skip to content

Commit

Permalink
Run the parser in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
Garanas committed May 5, 2024
1 parent c5e53ba commit deb9e70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public class ReplayDataParser {
@Getter
private List<GameOption> gameOptions;

@Getter
private List<Token> tokens;

@Getter
private List<Event> events;

Expand Down Expand Up @@ -441,7 +444,7 @@ private void parse() throws IOException, CompressorException {
LittleEndianDataInputStream dataStream = new LittleEndianDataInputStream(new ByteArrayInputStream(data));
parseHeader(dataStream);

List<Token> tokens = Tokenizer.tokenize(dataStream);
tokens = Tokenizer.tokenize(dataStream);
events = Parser.parseTokens(tokens);
interpretEvents(events);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class Parser {
public static List<Event> parseTokens (List<Token> tokens) throws IOException {
return tokens.stream().map((token) -> {
return tokens.stream().parallel().map((token) -> {
try {
return parseToken(token);
} catch (Exception exception) {
Expand Down

0 comments on commit deb9e70

Please sign in to comment.