diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-01-27 14:26:09 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-01-27 14:26:09 +0100 |
| commit | 0258e7d4f8dca70aee8d992b68b9fe587c7a7811 (patch) | |
| tree | d1ce82712434d674248ca1538a70bb2478cdaad5 | |
| parent | 2ec4942cc0928d80b7313a4a8844e11708bfc7ac (diff) | |
Debug and update readme
| -rw-r--r-- | README.md | 36 | ||||
| -rw-r--r-- | src/PGN.cpp | 13 |
2 files changed, 43 insertions, 6 deletions
@@ -10,7 +10,41 @@ PGN specification can be found [here](https://www.chessclub.com/help/PGN-spec). - Basic PGN parsing (tags, move, comments, variations, NAG, etc.) - Parse PGN files that contains multiple games - Handle very large files: up to 2^(sizeof(unsigned long long)*8) bytes -- Efficiency +- Efficiency: + +<b></b> + + # cpu: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz + # file name: lichess_db_standard_rated_2017-06.pgn + # file sha1sum: af8e01ab9709950be1804880d22d094324df5338 + # file source: https://database.lichess.org/#standard_games + # file number of games: 11512600 + # file size: 24.6GB + # pgnp FILE_BUFFER_SIZE: (1024 * 1024 / 2) + + > User time (seconds): 599.81 + > System time (seconds): 2.72 + > Percent of CPU this job got: 99% + > Elapsed (wall clock) time (h:mm:ss or m:ss): 10:03.17 + > Average shared text size (kbytes): 0 + > Average unshared data size (kbytes): 0 + > Average stack size (kbytes): 0 + > Average total size (kbytes): 0 + > Maximum resident set size (kbytes): 4484 + > Average resident set size (kbytes): 0 + > Major (requiring I/O) page faults: 0 + > Minor (reclaiming a frame) page faults: 784 + > Voluntary context switches: 4 + > Involuntary context switches: 6649 + > Swaps: 0 + > File system inputs: 0 + > File system outputs: 0 + > Socket messages sent: 0 + > Socket messages received: 0 + > Signals delivered: 0 + > Page size (bytes): 4096 + > Exit status: 0 + # How to use it ? PGNP can be used as a shared library in your project. diff --git a/src/PGN.cpp b/src/PGN.cpp index 0f15fb3..dcc0661 100644 --- a/src/PGN.cpp +++ b/src/PGN.cpp @@ -59,6 +59,10 @@ void PGN::ParseNextGame() { } else if (IS_DIGIT(c)) { LastGameEndLoc = ParseHalfMove(loc, moves); break; + } else if (c == '*') { + result = "*"; + LastGameEndLoc=loc+1; + break; } else if (c == '{') { loc = ParseComment(loc, moves); continue; // No need loc++ @@ -330,11 +334,10 @@ loctype PGN::GotoNextToken(loctype loc) { c = pgn_content[loc]; if (c == '%' || c == ';') { loc = GotoEOL(loc); - if(!IS_EOF){ - c=pgn_content[loc]; - } - else{ - return(loc); + if (!IS_EOF) { + c = pgn_content[loc]; + } else { + return (loc); } } } |
