Skip to content

Commit 9433142

Browse files
perf: cache split regex
1 parent c5f8b62 commit 9433142

File tree

5 files changed

+353
-584
lines changed

5 files changed

+353
-584
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ The following table shows the accuracy of the token count approximation for diff
1111
| --- | --- | --- | --- |
1212
| Short English text | 10 | 11 | 10.00% |
1313
| German text with umlauts | 56 | 49 | 12.50% |
14-
| Metamorphosis by Franz Kafka (English) | 31891 | 33928 | 6.39% |
15-
| Die Verwandlung by Franz Kafka (German) | 40620 | 34908 | 14.06% |
16-
| 道德經 by Laozi (Chinese) | 14386 | 11919 | 17.15% |
17-
| TypeScript ES5 Type Declarations (~ 4000 loc) | 47890 | 50464 | 5.37% |
14+
| Metamorphosis by Franz Kafka (English) | 31892 | 33930 | 6.39% |
15+
| Die Verwandlung by Franz Kafka (German) | 40621 | 34908 | 14.06% |
16+
| 道德經 by Laozi (Chinese) | 14387 | 11919 | 17.15% |
17+
| TypeScript ES5 Type Declarations (~ 4000 loc) | 48408 | 51688 | 6.78% |
1818
<!-- END GENERATED TOKEN COUNT TABLE -->
1919

2020
## Features

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "tokenx",
33
"type": "module",
44
"version": "0.4.0",
5-
"packageManager": "[email protected].2",
5+
"packageManager": "[email protected].4",
66
"description": "GPT token estimation and context size utilities without a full tokenizer",
77
"author": "Johann Schopplich <[email protected]>",
88
"license": "MIT",
@@ -52,14 +52,14 @@
5252
"release": "bumpp"
5353
},
5454
"devDependencies": {
55-
"@antfu/eslint-config": "^3.9.2",
56-
"@types/node": "^22.9.3",
55+
"@antfu/eslint-config": "^3.11.2",
56+
"@types/node": "^22.10.1",
5757
"bumpp": "^9.8.1",
5858
"eslint": "^9.15.0",
59-
"gpt-tokenizer": "^2.6.2",
59+
"gpt-tokenizer": "^2.7.0",
6060
"tsx": "^4.19.2",
61-
"typescript": "^5.6.3",
61+
"typescript": "^5.7.2",
6262
"unbuild": "^3.0.0-rc.11",
63-
"vitest": "^2.1.5"
63+
"vitest": "^2.1.6"
6464
}
6565
}

0 commit comments

Comments
 (0)