Commit Graph

84 Commits

Author SHA1 Message Date
Raph Levien df37994166 Use perfect hashing for decomposition also 2019-04-09 17:20:27 -07:00
Raph Levien b68dbec11f More lookups moved to perfect hashing 2019-04-09 16:46:28 -07:00
Raph Levien 274b267525 Use minimal perfect hashing for combining class lookup 2019-04-09 12:26:24 -07:00
Raph Levien 6407e5f127 Update unicode script to Python 3 2019-04-09 10:43:25 -07:00
Sujay Jayakar 35cc77d8ad Bump version to 0.1.8 2019-01-21 13:02:48 -08:00
Sujay Jayakar 32f859c523 Merge pull request #35 from djudd/smallvec
Use Smallvec in decomposition & recomposition
2019-01-21 11:32:30 -08:00
Sujay Jayakar d9e05260c6 Merge branch 'master' into smallvec 2019-01-21 11:22:08 -08:00
David Judd b114982681 Add comment 2019-01-17 08:41:47 -08:00
David Judd c6524d31d4 Use fuse 2019-01-17 08:28:15 -08:00
David Judd cc81a58409 Revert "restore done field to Decompositions"
This reverts commit 099fef3b72.
2019-01-17 08:25:11 -08:00
David Judd 099fef3b72 restore done field to Decompositions 2019-01-15 21:31:18 -08:00
Sujay Jayakar a09e329414 Merge pull request #31 from djudd/no-package-test-code
Use cargo exclude for tests
2019-01-15 16:15:22 +05:30
David Judd cae615d215 Use cargo exclude 2019-01-14 20:27:50 -08:00
Sujay Jayakar e03d61cce8 Merge pull request #36 from djudd/compatibility-quick-checks
Add quick check implementations for NFKC & NFKD
2019-01-14 22:40:37 +05:30
David Judd 5685166427 Add quick check implementations for NFKC & NFKD 2019-01-12 14:44:53 -08:00
David Judd 70741bd31d Use SmallVec in place of VecDeque in recompose 2019-01-12 11:01:54 -08:00
David Judd 29e7a0ba40 Use SmallVec in place of Vec in decompose & avoid remove(0) 2019-01-12 11:01:22 -08:00
David Judd 79e9942f2a Add smallvec 2019-01-12 10:59:23 -08:00
David Judd 5ae55400d9 More benchmarks 2019-01-12 10:58:41 -08:00
Manish Goregaokar 534e19eed8 Merge pull request #34 from dotdash/improv_codegen
Generate code that is friendlier to rustc's item_bodies_checking
2019-01-08 09:35:49 -08:00
Björn Steinbrink 41914c5d30 Generate code that is friendlier to rustc's item_bodies_checking
Having the Some() constructor in each match arm body puts extras stress
on rustc's item_bodies_checking pass. We can work around that by moving
the Some() constructor around the match, and directly returning None
from the default arm, which is the only one that generates a None value.

On my box, this almost cuts the time spent in item_bodies_checking in
half, going from about 8.7s to about 4.6s, and reduces the complete
compile time from about 13s to about 9s, so about a third less.

There are no changes in performance in `cargo bench`.

Note that doing the same for the composition_table() function does not
yield any compile time wins, but would cause a performance regression.

cc #29
2019-01-08 17:02:41 +01:00
Manish Goregaokar 3a99765a62 Merge pull request #27 from dbrgn/ci
CI: Test on stable, nightly and 1.21
2018-06-14 14:47:20 -07:00
Danilo Bargen cf80b56ce6 Link to docs.rs
This way we don't have to build custom docs anymore.
2018-06-14 23:45:23 +02:00
Danilo Bargen f99bfdf347 Travis: Test on stable, nightly and 1.21 2018-06-14 10:24:09 +02:00
Sujay Jayakar c9438425fd Merge pull request #25 from sujayakar/bump-version
Bump version (and update docs)
2018-05-09 12:42:33 -07:00
Sujay Jayakar 7389eb31f1 Bump version (and update docs) 2018-05-09 12:39:23 -07:00
Sujay Jayakar 45364f03c2 Merge pull request #24 from sujayakar/quick-ss
Implement Stream-Safe QuickCheck variant
2018-05-09 12:04:58 -07:00
Sujay Jayakar ef9a4dd691 Implement Stream-Safe QuickCheck variant 2018-05-07 20:55:59 -07:00
Sujay Jayakar 8dc3dc3932 Merge pull request #23 from sujayakar/hangul-fix
Fix corner case in Hangul composition
2018-05-07 20:08:30 -07:00
Sujay Jayakar ef810e3380 Update range naming 2018-05-07 20:02:04 -07:00
Sujay Jayakar 3156992b87 Factor out T_START from match statement 2018-05-07 19:14:55 -07:00
Sujay Jayakar 9f6cc853cc Fix corner case in Hangul composition 2018-05-07 15:34:22 -07:00
Alex Crichton 75a37d6c6c Merge pull request #22 from sujayakar/unicode-opts2
Implement Stream-Safe Text Process and QuickCheck algorithms
2018-05-02 11:04:34 -05:00
Sujay Jayakar 4d7e81e0ab Add Stream-Safe Text Process (for interop with golang's unicode/norm package) 2018-05-01 21:43:04 -07:00
Sujay Jayakar 6a7e38e376 Refactor Unicode script, emit new tables, and add QuickCheck algorithm. 2018-05-01 21:00:38 -07:00
Sujay Jayakar 4d76b961b8 Remove unnecessary unwrap in recompose 2018-04-27 13:37:29 +05:30
Sujay Jayakar 74dddd6f8d Remote unnecessary transmute (in favor of char::from_u32_unchecked) 2018-04-27 13:37:20 +05:30
Sujay Jayakar 0e821ff949 Simplify decomposition
- Eliminate custom sorter
  - Only sort the "pending" suffix of the buffer
2018-04-27 13:37:16 +05:30
Sujay Jayakar e97357d282 Add benchmarks 2018-04-27 13:37:08 +05:30
Simon Sapin 97ebf36266 Update version in README 2017-06-15 17:43:11 +02:00
Simon Sapin 22f67aced1 Merge pull request #17 from behnam/dev
Fix is_combining_mark table data
2017-06-15 17:39:28 +02:00
Behnam Esfahbod 0f11303c65 Bump version to 0.1.5 2017-06-01 15:21:31 -06:00
Behnam Esfahbod 1e74c347b6 Fix is_combining_mark table data
* In `scripts/unicode.py`, the data used to generate `is_combining_mark()`
was being passed to the emit function incorrectly, resulting in the
table containing some other data instead. The script is fixed and new
`tables.rs` is generated.

* Add test for `is_combining_mark()` for ASCII chars, as well as a
couple of random chars based on the reported issue.

Fix https://github.com/unicode-rs/unicode-normalization/issues/16
2017-06-01 15:10:29 -06:00
Simon Sapin 3898e77b11 Merge pull request #14 from froydnj/trim-unicode-tables
reduce space required by decomposition and composition tables
2017-04-12 17:11:46 +08:00
Manish Goregaokar 6dbfd72adc Merge pull request #12 from clarcharr/master
Implement Display for Recompositions, Decompositions
2017-04-02 11:15:38 -07:00
Nathan Froyd 8d01bc5e88 store smaller slices in unicode data tables
Rust's default slices are convenient, but for tables like:

  const f: &'static [(char, &'static [char])]

they take up far too much space.  An element of the above array consumes
24 bytes on 64-bit platforms, and unicode-normalization contains about
6000 such array elements.

A better approach is to manually store a smaller slice type:

  struct Slice {
    offset: u16,
    length: u16,
  }

  const f: &'static [(char, Slice)]

and store the actual character data in a separate array on the side.
The `Slice` structures then point in to this separate array, but at a
much smaller space cost: elements of the modified `f` take up only 8
bytes on 64-bit platforms, which implies a space savings of ~96K on
64-bit platforms.  On some systems, this strategy also eliminates the
necessity of run-time relocations, which can be a further, significant
savings in binary size and runtime cost.

This change is strictly local to the library; it does not affect the
public API.
2017-03-27 16:58:31 -04:00
Nathan Froyd 7552e6cd2b format tables with one entry per line
This change avoids formatting table entries into a string, only to split
them apart again.  The new format is also slightly easier to read and
compare when changes are made to how the tables are organized.
2017-03-27 15:13:36 -04:00
Nathan Froyd 6190241cc9 use more idiomatic python in unicode.py
STR.join(...) is better than manual `for` loops that remember whether
we've processed the first element.
2017-03-27 14:26:35 -04:00
Simon Sapin 414a14f653 Merge pull request #13 from Manishearth/ignore-txt
Ignore .txt files so that they don't get published
2017-02-04 17:23:20 +01:00
Manish Goregaokar 0b717f8c08 Ignore .txt files so that they don't get published 2017-02-03 16:52:48 -08:00